title: Is it possible to initialize auto variable with auto class method?
body: <p>I met some problem regarding <code>auto</code> specifier using c++14.</p>
  <p>I defined the class in header file as below,</p>
  <pre><code>class MiscFeature
  {
  
  public:
      MiscFeature();
      auto getData();
      auto setData(int);
  
  private:
      int data;
  
  };
  </code></pre>
  <p>Then calling the method in main file,</p>
  <pre><code>int
  main(int argc, char** argv)
  {
  
      MiscFeature * misc = new MiscFeature();
  
      auto val = misc-&gt;getData();
      cout&lt;&lt;val&lt;&lt;endl;
      val = misc-&gt;setData(6);
      cout&lt;&lt;val&lt;&lt;endl;
  }
  </code></pre>
  <p>Then compiling with g++, I got the following errors:</p>
  <blockquote>
  <p>test.cpp:21:30: error: use of <code>auto MiscFeature::getData()</code> before deduction of <code>auto</code></p>
  <pre><code>auto val = misc-&gt;getData();
  </code></pre>
  </blockquote>
  <p>If I define the similar function in the main file, it's okay.</p>
  <p>How could I fix such problem? Or is this a limitation?</p>