post  .* and ->* operators

darkestfright (133)   Link to this post
Just a quick Q:

is

1
2
obj.*memberVariable
ptr->*memberVariable


Equivalent to:

1
2
*(obj.memberVariable)
*(ptr->memberVariable)
firedraco (2606)   Link to this post
No. There is no .* or ->* operator AFAIK. I don't think the top 2 lines would even compile.
guestgulkan (1280)   Link to this post
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)


This topic is archived - New replies not allowed.