A confusing typedef involves class scope

前端 未结 2 494
既然无缘
既然无缘 2021-02-01 01:07

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::         


        
2条回答
  •  一整个雨季
    2021-02-01 01:13

    ns::B::*
    

    is a pointer-to-member-variable of B. Then ns::A* is its type.

    So the whole declaration means

    pointer-to-member-variable of B of type ns::A*

提交回复
热议问题