Nested namespace in C++

P

Pallav singh

Hi All,

whats the usage of having nested namespace in c++ ?

Thanks
Pallav Singh
 
J

Juha Nieminen

Pallav singh said:
whats the usage of having nested namespace in c++ ?

The same as having inner classes and types? Organization and minimizing
global namespace pollution.
 
Q

Qi

whats the usage of having nested namespace in c++ ?

IMHO, nested namespace is not as useful as sub package in Java.
Maybe due to usually Java IDEs have good support to auto complete
for sub packages.

I personally prefer one top namespace only.

However, I think nested namespace is useful for internal
and private implementation.
A nested namespace "_internal" implicit that the user should
not use it.
Boost library uses lots of nested namespace for that purpose.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top