prog.cpp: In instantiation of ‘auto time_function_1(T&&, U&& ...) [with T = int (&)(int, int); U = {int, int}]’:
prog.cpp:33:23: required from here
prog.cpp:8:56: error: no matching function for call to ‘forward<int, int>(int&, int&)’
auto val = std::forward<T>(func)(std::forward<U...>(args...));
~~~~~~~~~~~~~~~~~~^~~~~~~~~
In file included from /usr/include/c++/8/bits/nested_exception.h:40,
from /usr/include/c++/8/exception:144,
from /usr/include/c++/8/ios:39,
from /usr/include/c++/8/ostream:38,
from /usr/include/c++/8/iostream:39,
from prog.cpp:1:
/usr/include/c++/8/bits/move.h:74:5: note: candidate: ‘template<class _Tp> constexpr _Tp&& std::forward(typename std::remove_reference<_Tp>::type&)’
forward(typename std::remove_reference<_Tp>::type& __t) noexcept
^~~~~~~
/usr/include/c++/8/bits/move.h:74:5: note: template argument deduction/substitution failed:
prog.cpp:8:56: error: wrong number of template arguments (2, should be 1)
auto val = std::forward<T>(func)(std::forward<U...>(args...));
~~~~~~~~~~~~~~~~~~^~~~~~~~~
In file included from /usr/include/c++/8/bits/nested_exception.h:40,
from /usr/include/c++/8/exception:144,
from /usr/include/c++/8/ios:39,
from /usr/include/c++/8/ostream:38,
from /usr/include/c++/8/iostream:39,
from prog.cpp:1:
/usr/include/c++/8/bits/move.h:85:5: note: candidate: ‘template<class _Tp> constexpr _Tp&& std::forward(typename std::remove_reference<_Tp>::type&&)’
forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
^~~~~~~
/usr/include/c++/8/bits/move.h:85:5: note: template argument deduction/substitution failed:
prog.cpp:8:56: error: wrong number of template arguments (2, should be 1)
auto val = std::forward<T>(func)(std::forward<U...>(args...));
~~~~~~~~~~~~~~~~~~^~~~~~~~~
prog.cpp:10:12: error: unable to deduce ‘auto’ from ‘val’
return val;
^~~