title: Failed to compile because of incompatible cv-qualifiers
body: <p>I have two template method</p>
  
  <pre><code>template &lt;typename T, typename Ret, typename ...Args&gt;
  Ret apply(T* object, Ret(T::*method)(Args...), Args&amp;&amp; ...args) {
      return (object-&gt;*method)(std::forward(args)...);
  };
  
  template &lt;typename T, typename Ret, typename ...Args&gt;
  Ret apply(T* object, Ret(T::*method)(Args...) const, Args&amp;&amp; ...args) {
      return (object-&gt;*method)(std::forward(args)...);
  };
  </code></pre>
  
  <p>My purpose is apply member <em>method</em> of class <strong>T</strong> on these <em>args</em></p>
  
  <p>this is my test code:</p>
  
  <pre><code>int main() {
      using map_type = std::map&lt;std::string, int&gt;;
      map_type map;
      map.insert(std::make_pair("a", 1));
      std::cout &lt;&lt; "Map size: " &lt;&lt; apply(&amp;map, &amp;map_type::size) &lt;&lt; std::endl; //this code work
      apply(&amp;map, &amp;map_type::insert, std::make_pair("a", 1)); //failed to compile
  
      return 0;
  }
  </code></pre>
  
  <p>This is compiler error message: </p>
  
  <pre><code>    test.cpp: In function ‘int main()’:
  test.cpp:61:58: error: no matching function for call to ‘apply(map_type*, &lt;unresolved overloaded function type&gt;, std::pair&lt;const char*, int&gt;)’
       apply(&amp;map, &amp;map_type::insert, std::make_pair("a", 1));
                                                            ^
  test.cpp:11:5: note: candidate: template&lt;class T, class Ret, class ... Args&gt; Ret apply(T*, Ret (T::*)(Args ...), Args&amp;&amp; ...)
   Ret apply(T* object, Ret(T::*method)(Args...), Args&amp;&amp; ...args) {
       ^~~~~
  test.cpp:11:5: note:   template argument deduction/substitution failed:
  test.cpp:61:58: note:   couldn't deduce template parameter ‘Ret’
       apply(&amp;map, &amp;map_type::insert, std::make_pair("a", 1));
  </code></pre>