.* and ->* operators

closed account (1yR4jE8b)
Just a quick Q:

is

1
2
obj.*memberVariable
ptr->*memberVariable


Equivalent to:

1
2
*(obj.memberVariable)
*(ptr->memberVariable)
No. There is no .* or ->* operator AFAIK. I don't think the top 2 lines would even compile.
They are the the pointer to class member dereference operators.

But I think your description/wording is slightly off and should read more like this:
Obj.*PointerToMember
PtrToObj->*PointerToMember


and I don't think the equivalent idea quite works -
Obj.*PointerToMember
is not the same as
*(obj.memberVariable)

Topic archived. No new replies allowed.