All these answers are somewhat correct in a narrow scope. You can use the -> operator even if you don't have a pointer because you can overload it. Take a look at smart pointers:
class A
{
public:
void foo();
}
class SmartPtr
{
public:
SmartPtr (A& obj)
{
instance = obj;
}
A instance;
A operator-> ()
{
return instance;
}
};
Then you can do:
A a;
SmartPtr smart(a);
smart->foo();
so you can use -> even though SmartPtr is not a pointer to an object of type SmartPtr.
This answer is in addition to previous ones, as they might be misleading. In a simple case, they are all correct. Note that the dot(.) operator cannot be overloaded.