-1
struct A { int x; };

int main() {
    int A::* pt = &A::x;
    return 0;
}

what does int A::* mean exactly? I have never seen C++ syntax like this.

Vertexwahn
  • 7,709
  • 6
  • 64
  • 90
linrongbin
  • 2,967
  • 6
  • 31
  • 59

1 Answers1

2

Just like other traits, you specify the template argument and use the value member.

std::is_member_object_pointer<decltype(pa) >::value

what does int A::* mean exactly?

That is a type declaration of a member object pointer to an int member of the class A.

eerorika
  • 232,697
  • 12
  • 197
  • 326