Felix Crazzolara
Felix Crazzolara

Reputation: 732

How to define alias to access enum class member through struct?

Given the following code:

class A {
    enum class B {
        Member
    };
    struct C {
    };
};

How can I define a type alias that allows me to access B::Member as C::B::Member?

Upvotes: 0

Views: 514

Answers (1)

Brian Bi
Brian Bi

Reputation: 119219

struct C {
    using B = A::B;
    // or: typedef A::B B;
};

Upvotes: 8

Related Questions