I'm reading code of a C++ project and it contains some code of the following form:
namespace ns {
class A {};
class B {};
}
struct C {
typedef ns::A* ns::B::* type;
};
Can someone explain the meaning of the typedef
line? type
seems to be some kind of pointer to member of ns::B
which points to ns::A
, but I'm not sure.
Class A
and B
in the real code are not empty, but I think it's not relevant here. And here is a live example.