Let's say I have the following variable:
MyObject* obj = ...; If this object has the field foo, there are two ways of accessing it:
obj->foo(*obj).foo
Are there any differences between using one method over the other. Or is the first method just syntactic sugar for the second?
I was thinking maybe the first one could cause the copy constructor of the object to be called since it is now holding onto the value.
operator->, the->has the "drill down" property where it is applied recursively until the resulting object is a pointer. q.v. stackoverflow.com/a/10460730/4641116