title: Compilation problem with std::async using g++8 and c++20
body: <p>I am trying to use <code>std::async</code>. I have written this code</p>
  
  <pre><code>template&lt;transport_type tt&gt;
  void stop_update_distances(const std::vector&lt;stop&gt;&amp; stops, stop&amp; from, const general_s&amp; s, const osrm_machine&amp; machine){
  //...not important code...
  }
  
  void tt_map::update_distances(pqxx::connection&amp; conn, const general_s&amp; s,
      const osrm_machine&amp; walk_machine, const osrm_machine&amp; car_machine){
  
    std::vector&lt;std::future&lt;void&gt;&gt; futures;
    futures.reserve(stops.size());
  
    for(stop&amp; from : stops){
      auto res = std::async(std::launch::async, stop_update_distances&lt;CAR&gt;, stops, from, s, car_machine);
      futures.push_back(res);          
    }
  
  }
  </code></pre>
  
  <p>but g++8 returned me this error</p>
  
  <pre><code>src/lib/tt_map.cpp: In member function ‘void kp::mp::tt_map::update_distances(pqxx::connection&amp;, const kp::general_s&amp;, const kp::osrm_machine&amp;, const kp::osrm_machine&amp;)’:
  src/lib/tt_map.cpp:383:108: error: no matching function for call to ‘async(std::launch, &lt;unresolved overloaded function type&gt;, std::vector&lt;kp::mp::stop&gt;&amp;, kp::mp::stop&amp;, const kp::general_s&amp;, const kp::osrm_machine&amp;)’
             auto res = std::async(std::launch::async, stop_update_distances&lt;CAR&gt;, stops, from, s, car_machine);
                                                                                                              ^
  In file included from src/lib/tt_map.cpp:11:
  /usr/include/c++/8/future:1712:5: note: candidate: ‘template&lt;class _Fn, class ... _Args&gt; std::future&lt;typename std::result_of&lt;typename std::decay&lt;_Tp&gt;::type(typename std::decay&lt;_Args&gt;::type ...)&gt;::type&gt; std::async(std::launch, _Fn&amp;&amp;, _Args&amp;&amp; ...)’
       async(launch __policy, _Fn&amp;&amp; __fn, _Args&amp;&amp;... __args)
       ^~~~~
  /usr/include/c++/8/future:1712:5: note:   template argument deduction/substitution failed:
  /usr/include/c++/8/future: In substitution of ‘template&lt;class _Fn, class ... _Args&gt; std::future&lt;typename std::result_of&lt;typename std::decay&lt;_Tp&gt;::type(typename std::decay&lt;_Args&gt;::type ...)&gt;::type&gt; std::async(std::launch, _Fn&amp;&amp;, _Args&amp;&amp; ...) [with _Fn = void (&amp;)(const std::vector&lt;kp::mp::stop&gt;&amp;, kp::mp::stop&amp;, const kp::general_s&amp;, const kp::osrm_machine&amp;); _Args = {std::vector&lt;kp::mp::stop, std::allocator&lt;kp::mp::stop&gt; &gt;&amp;, kp::mp::stop&amp;, const kp::general_s&amp;, const kp::osrm_machine&amp;}]’:
  src/lib/tt_map.cpp:383:108:   required from here
  /usr/include/c++/8/future:1712:5: error: no type named ‘type’ in ‘class std::result_of&lt;void (*(std::vector&lt;kp::mp::stop&gt;, kp::mp::stop, kp::general_s, kp::osrm_machine))(const std::vector&lt;kp::mp::stop&gt;&amp;, kp::mp::stop&amp;, const kp::general_s&amp;, const kp::osrm_machine&amp;)&gt;’
  /usr/include/c++/8/future:1745:5: note: candidate: ‘template&lt;class _Fn, class ... _Args&gt; std::future&lt;typename std::result_of&lt;typename std::decay&lt;_Tp&gt;::type(typename std::decay&lt;_Args&gt;::type ...)&gt;::type&gt; std::async(_Fn&amp;&amp;, _Args&amp;&amp; ...)’
       async(_Fn&amp;&amp; __fn, _Args&amp;&amp;... __args)
       ^~~~~
  /usr/include/c++/8/future:1745:5: note:   template argument deduction/substitution failed:
  /usr/include/c++/8/future: In substitution of ‘template&lt;class _Fn, class ... _Args&gt; std::future&lt;typename std::result_of&lt;typename std::decay&lt;_Tp&gt;::type(typename std::decay&lt;_Args&gt;::type ...)&gt;::type&gt; std::async(_Fn&amp;&amp;, _Args&amp;&amp; ...) [with _Fn = std::launch; _Args = {void (&amp;)(const std::vector&lt;kp::mp::stop, std::allocator&lt;kp::mp::stop&gt; &gt;&amp;, kp::mp::stop&amp;, const kp::general_s&amp;, const kp::osrm_machine&amp;), std::vector&lt;kp::mp::stop, std::allocator&lt;kp::mp::stop&gt; &gt;&amp;, kp::mp::stop&amp;, const kp::general_s&amp;, const kp::osrm_machine&amp;}]’:
  src/lib/tt_map.cpp:383:108:   required from here
  /usr/include/c++/8/future:1745:5: error: no type named ‘type’ in ‘class std::result_of&lt;std::launch(void (*)(const std::vector&lt;kp::mp::stop&gt;&amp;, kp::mp::stop&amp;, const kp::general_s&amp;, const kp::osrm_machine&amp;), std::vector&lt;kp::mp::stop&gt;, kp::mp::stop, kp::general_s, kp::osrm_machine)&gt;’
  </code></pre>
  
  <p>which I don't really understand.</p>
  
  <p>I have followed the example in <a href="https://en.cppreference.com/w/cpp/thread/async" rel="nofollow noreferrer">cppreference.com</a>. Even though it doesn't work.</p>
  
  <p>Thank you for any hint, what is wrong.</p>