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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With