title: Alternative for std::bind in modern C++
body: <p>So I'm trying to create a class which has a container for functors of a different type.</p>
  
  <p>This is a simplified version of it.</p>
  
  <pre><code>template&lt;class T&gt;
  class Container
  {
  
  public:
      template&lt;typename F, typename ... ARGS&gt;
      void addTask(F &amp;&amp; func, ARGS &amp;&amp; ... args);
  private:
      std::deque&lt;std::function&lt;T()&gt;&gt; container;
  
      //.....
  };
  
  template&lt;class T&gt;
  template&lt;typename F, typename ... ARGS&gt;
  T Container&lt;T&gt;::addTask(F &amp;&amp; func, ARGS &amp;&amp; ... args);
  {
      container.emplace_back(std::bind(f,args...));
  
      //.....
  }
  </code></pre>
  
  <p>There are still few problems that I cannot solve yet.</p>
  
  <ol>
  <li>Is there a way to remove <code>std::bind</code> and store a different object or a pointer?</li>
  <li>Could this be more generic? Can I somehow store functions, which return different objects, in a single container(<code>int</code>,<code>void</code>...)?</li>
  <li>Can some of the logic for creating the tasks be executed in compile time?Something like <code>consexpr</code> bind.</li>
  </ol>