Nested namespace in C++

Discussion in 'C++' started by Pallav singh, Jul 23, 2012.

  1. Pallav singh

    Pallav singh Guest

    Hi All,

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

    Thanks
    Pallav Singh
    Pallav singh, Jul 23, 2012
    #1
    1. Advertising

  2. Pallav singh <> wrote:
    > whats the usage of having nested namespace in c++ ?


    The same as having inner classes and types? Organization and minimizing
    global namespace pollution.
    Juha Nieminen, Jul 23, 2012
    #2
    1. Advertising

  3. Pallav singh

    Qi Guest

    On 2012-7-23 15:07, Pallav singh wrote:
    >
    > 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.


    --
    WQ
    Qi, Jul 28, 2012
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Èý¹â
    Replies:
    1
    Views:
    552
    William F. Robertson, Jr.
    Jul 29, 2003
  2. Replies:
    0
    Views:
    5,106
  3. Anonymous
    Replies:
    3
    Views:
    510
    Ron Natalie
    Aug 18, 2003
  4. Jason Heyes
    Replies:
    1
    Views:
    435
    Woebegone
    Nov 19, 2004
  5. Petter Reinholdtsen
    Replies:
    9
    Views:
    4,328
    Howard
    Nov 29, 2004
Loading...

Share This Page