title: "No matching function for call" error when creating a vector of function variants
body: <p>I'm trying to create a <code>std::vector</code> that can hold <code>std::function</code> objects of different signatures using <code>std::variant</code>.</p>
  
  <p>Why does the following code not compile:</p>
  
  <pre><code>#include &lt;functional&gt;
  #include &lt;variant&gt;
  #include &lt;vector&gt;
  
  int main()
  {
    std::vector&lt;std::variant&lt;
        std::function&lt; int (const std::vector&lt;float&gt;&amp;, int) &gt;,
        std::function&lt; float (const std::vector&lt;float&gt;&amp;, int) &gt;
    &gt;&gt; func_vector;
  
    func_vector.emplace_back( [] (const std::vector&lt;float&gt;&amp; ret, int index) { return ret.size(); });
  
    return 0;
  }
  </code></pre>
  
  <p>The problem happens during the <code>emplace_back()</code>. Compiling this gives a long list of errors, the first one listed being:</p>
  
  <pre><code>error: no matching function for call to ‘std::variant&lt;std::function&lt;int(const std::vector&lt;float, std::allocator&lt;float&gt; &gt;&amp;, int)&gt;, std::function&lt;float(const std::vector&lt;float, std::allocator&lt;float&gt; &gt;&amp;, int)&gt; &gt;::variant(main()::&lt;lambda(const std::vector&lt;float&gt;&amp;, int)&gt;)’
    { ::new((void *)__p) _Up(std::forward&lt;_Args&gt;(__args)...); }
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  </code></pre>
  
  <p>It says that it cannot find a matching function, but for what call exactly?</p>
  
  <p>The lambda I'm trying to emplace has exactly the signature of one of the types I specified in the variant, so all should be fine, shouldn't it?</p>