title: C++ when you dereference a pointer to a class object and then return it as a reference, can you call methods on this reference
body: <p>In the code below <code>CompositionalModel</code> is an abstract class. The class <code>OpModel</code> provides implementations of the virtual functions. </p>
  
  <p>In the class <code>CompilationUnit</code> there is a member variable <code>model</code> which is a pointer to an <code>OpModel</code> class. </p>
  
  <p>My question is: the method <code>model()</code> dereferences the pointer and returns it as a reference of type CompositionalModel. When you dereference a pointer and return it as a reference now an object that you can call methods on? </p>