0

I have a nested class declared as:

class A
{
    class B
    {
         // members
    };

    // members
};

Is there a good way to avoid typing A::B every time I need to access B's members? I'd just like to do this in one .cpp file. I tried "using namespace A;" but I found out that class scopes and namespace scopes are not the same thing.

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Jsplinter
0

You need to declare A as a namespace. Then you can put

using A::B;

once and just use the class name.

Edited by hag++: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.