Reputation: 213
I have the following code:
struct myType { myType * ptr; };
typedef myType * myType ::* other_type;
What is the second line typedef'ining? Is that a member function that returns a myType pointer or something else?
Upvotes: 5
Views: 244
Reputation: 249502
That defines other_type
as a pointer to a member of myType
where said member is itself a pointer to myType
. For example, you could use it this way:
other_type x = &myType::ptr;
myType mine;
mine.*x = &mine;
Why you would do that, I can't say.
Upvotes: 6