Is there a better way to express nested namespaces in C++ within the header

前端 未结 11 2451
天涯浪人
天涯浪人 2020-12-13 03:31

I switched from C++ to Java and C# and think the usage of namespaces/packages is much better there (well structured). Then I came back to C++ and tried to use namespaces the

11条回答
  •  一整个雨季
    2020-12-13 03:44

    To avoid really deep indenting, I usually do it this way:

    namespace A { namespace B { namespace C
    {
        class X
        {
            // ...
        };
    }}}
    

提交回复
热议问题