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.