How to name the namespace of my new project?

I am going to create a new library that displays genome annotations in diagrams. However, since C ++ does not have a centralized library website such as Perl, how do I know if a namespace conflicts with any existing one?

+8
c ++ namespaces
source share
2 answers

No, xd not a good name: it is too short. This may be a good alias in a limited context, but for a library to be used by others, specify a long descriptive name. Users can then select an alias that makes sense for their project.

 namespace my_company { namespace XnoDraw { // ... } // namespace XnoDraw } // namespace my_company // user code, not your code: namespace xd = my_company::XnoDraw; 
+12
source share

You can use anything other than std .
Note that C ++ does not allow the creation of complex names for namespaces.

For example:

 // Allowed namespace a { namespace b { int c; } } // Not allowed namespace a::b { int c; } 
+1
source share

All Articles