Actually C++ header files should NEVER have a using statement in them.Quote:
What's this fuss about header files. Isn't it just to include namespaces like say
using namespace System;
This forces the inclusion of the namespace into the scope of every client which wishes to use the header. In headers, the namespace should always be explicit:
Of couse you do need to "#include" the appropriate headers in your header...Code:void f(std::string s, std::vector<int> vec);
Again addidional details that make C++/CLI "harder" and more error prone. To summarize:
#1) Any time there is a "using" statement in a header... IT IS A DESIGN ERROR
#2) Any time a header file does not internally reference all required headers and requiures a user (.cpp file) to pre-include another header... IT IS A DESIGN ERROR
#3) Any time you do not have appropriate guards to gracefully and properly handle multiple includes of the same header file within a .cpp... IT IS A DESIGN ERROR.
None of these three things can happen in C#.
