zell
zell

Reputation: 10204

Does "A::B::C v;" means that A and B are namespaces and C is a class?

When you see an instruction like

A::B::C v;

in a code, does it mean that A and B are namespaces defined in some header file, and C is a class in the namespace B?

Upvotes: 1

Views: 188

Answers (1)

JeJo
JeJo

Reputation: 32972

It could be following three possibilities:

namespace A {
    namespace B {
        using C = int; // some types
    }
}

or

namespace A
{
    struct B
    {
        using C = int;  // some types
    };
};

or

struct A
{
    struct B
    {
        using C = int;  // some types
    };
};

You need to look into the source code to confirm!

Upvotes: 3

Related Questions