title: Type alias for std::function
body: <p>I'm trying to alias the <code>std::function</code> type because I plan on using something else in the future. And I would like to be able to easily make that change. But I'm getting an error message from the compiler that I don't really understand. I understand what it means but I don't understand it in this context.</p>
  
  <p>Example:</p>
  
  <pre><code>#include &lt;functional&gt;
  
  template &lt; typename Ret, typename... Args &gt; using MyFunc = std::function&lt; Ret(Args...) &gt;;
  
  int main(int argc, char **argv)
  {
      MyFunc&lt;void(int)&gt; fn;
  
      return 0;
  }
  </code></pre>
  
  <p>Generates:</p>
  
  <pre><code>..\main.cpp|7|required from here|
  ..\main.cpp|3|error: function returning a function|
  </code></pre>