title: Is there a type-erased function wrapper in the Standard Library that matches std::thread's constructor semantics?
body: <p>I need to create a non-template class¹ that needs to hold a callable and its arguments, in order to invoke them at a later point.</p>
  
  <p>Since this class is modelling an async execution, I'd like to give it API and semantics matching the ones of <code>std::thread</code> / <code>std::async</code>: </p>
  
  <pre><code>class Async {
  public:
      template &lt;typename Function, typename... Args &gt;
      explicit Async(Function&amp;&amp; f, Args &amp;&amp;... args)
      {
           // perform a (decay) copy of the args,
           // store f and the copy somewhere
      }
  
      void call() 
      {
          // to be possibly called in a different thread;
          // call the function stored. no need to return the results
      }
  
  private:
      // which data members?
  };
  </code></pre>
  
  <p>The first thing that came into my mind is use a <code>std::function&lt;void()&gt;</code> as the only data member, and initialize it from a <code>std::bind</code> over the arguments. </p>
  
  <p>However, this doesn't work: <code>std::function</code> and <code>std::bind</code> don't support move-only types, and <code>std::bind</code> simply does not work in terms of <code>std::invoke</code> (and it does a lot of extra magic, like recursively resolve bindings).</p>
  
  <p>Am I missing some easy-to-reach solution available in the Standard Library to implement this, or should I deploy my own binder and type-erased function wrapper classes?</p>
  
  <hr>
  
  <p>¹ Long story short: this class needs to inherit from a base class with virtual methods, so making this class a template class would cause the usual code bloat and clashes due to the duplication of virtual tables and virtual methods appearing everywhere.</p>