Creating a C++ namespace in header and source (cpp)

前端 未结 8 1568
猫巷女王i
猫巷女王i 2020-12-23 00:22

Is there any difference between wrapping both header and cpp file contents in a namespace or wrapping just the header contents and then doing using namespace

8条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-23 01:03

    The Foo::TheFunc() is not in the correct namespacein the VS-case. Use 'void X::Foo::TheFunc() {}' to implement the function in the correct namespace (X).

提交回复
热议问题