title: C++, Visual Studio: unexpected std::async return type
body: <p>I'm trying to save multiple <code>std::future</code>s in a <code>QMap</code>. The <code>QMap</code> is a member variable of my class:</p>
  
  
  
  <pre class="lang-cpp prettyprint-override"><code>QMap&lt;QString, std::future&lt;cv::Mat&gt;&gt; threads;
  </code></pre>
  
  <p>I now want to store the results of multiple <code>std::async</code> calls in this map, like this:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>this-&gt;threads.insert(filename, std::async(std::launch::async, &amp;MainInterface::readImage, this, path, true));
  </code></pre>
  
  <p>The function <code>readImage</code>, that is called asynchronously here, looks like this:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>cv::Mat MainInterface::readImage(QString path, bool emitSignals) {
      //some code
      return image;
  }
  </code></pre>
  
  <p>So the return value of the async function should be an <code>std::future&lt;cv::Mat&gt;</code> I think. However, when trying to compile, Visual Studio 2015 gives me the following compier error:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>no instance of overloaded function "QMap&lt;Key, T&gt;::insert [with Key=QString, T=std::future&lt;cv::Mat&gt;]" matches the argument list, argument types are: (QString, std::future&lt;cv::Mat (&amp;)(QString path, bool emitSignals)&gt;), object type is: QMap&lt;QString, std::future&lt;cv::Mat&gt;&gt;
  </code></pre>
  
  <p>What puzzles me is the return type <code>std::future&lt;cv::Mat (&amp;)(QString path, bool emitSignals)&gt;</code>, which is different from the <code>std::future&lt;cv::Mat&gt;</code> that I expected.</p>