C++ namespace help -


If I have many squares and I have to put them all under the same namespace and in my project I just want to And he will give me all classes how will I do this? I played with this but kill a dead end.

Thanks in advance.

If you want to include only one, there is nothing with namespaces.

You can create a file that contains only the #include statement.

Something like this:

  // class file #include "classA" #include "classb" #include "classC"  

And include all

#include "classes"

A real example can be found in STL.

code> vector for example:

  #ifndef _GLIBCXX_VECTOR #define _GLIBCXX_VECTOR 1 #pragma gcc system_header #include & lt; Bits / stl_algobase.h & gt; # Include & lt; Bits / allocator.h & gt; # Include & lt; Bits / stl_construct.h & gt; #include & lt; Bits / stl_uninitialized.h & gt; # Include & lt; Bits / stl_vector.h & gt; #include & lt; Bits / stl_bvector.h & gt; #ifndef _GLIBCXX_EXPORT_TEMPLATE #include & lt; Bits / vector.tcc & gt; #endif #ifdef _GLIBCXX_DEBUG # include & lt; Debug / Vector & gt; #endif #endif/ * _GLIBCXX_VECTOR * /  

You can only #include & lt; Vector & gt;

/ html>

Comments