title: C++ can't call method
body: <p>I've got the following code and have no idea how I can call the AMethod() function. Can anyone help me with this? 
  Thank you </p>
  
  <pre><code>template&lt;&gt;
  class AClass &lt; std::shared_ptr&lt;AnObject&gt; &gt;
  {
  public:
      std::shared_ptr&lt;AnObject&gt; AMethod() const
      {
          //DoStuff
          return std::make_shared&lt;AnObject&gt;(x);
      }
  };
  </code></pre>
  
  <p>I tried something like this, but it didn't work:</p>
  
  <pre><code>AClass &lt; std::shared_ptr&lt;AnObject&gt; &gt; instance(); 
   std::shared_ptr&lt;AnObject&gt; result = instance.AMethod();
  </code></pre>
  
  <p>I get "Error: Expression must have class type" on the second line on instance.</p>