title: Auto return type in template
body: <p>I have got multiple data classes, in various modules in my code, which i do no intend to modify whatsoever.
  I have a container classes for each of them, which have a pointer to this data class, and also got a pointer to a class which is intended to hold these classes without knowing about them.</p>
  
  <p>So in the container classes I implemented:</p>
  
  <pre><code>DataClass GetMyData (void){
     return myData;
  }
  </code></pre>
  
  <p>And in the collection of these cointainer classes i created</p>
  
  <pre><code>template&lt;class ContainerClass&gt;
  ContainerClass  GetContainer (void);
  
  template&lt;class ContainerClass&gt;
  auto    GetData (void){
      GetContainer&lt;ContainerClass&gt; ().GetMyData();
  }
  </code></pre>
  
  <p>But whenever i try to use this GetData function i get the error</p>
  
  <blockquote>
    <p>a function that returns 'auto' cannot be used before it is defined</p>
  </blockquote>
  
  <p>So my question is, is it possible to use auto in this case (c++11), or i have to make my template with 2 classes?</p>