Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 5 years ago

Language

C++

Compiler

gcc HEAD 11.0.0 20200804 (experimental)

Options
Warnings
Don't Use Boost
C++2a
no pedantic

Author

anonymous

almost 5 years ago

$ g++ prog.cc -Wall -Wextra -std=c++2a
prog.cc: In instantiation of 'static Time perf_timer<Time, Clock>::duration(F&&, Args ...) [with F = void (&)(std::unique_ptr<int>); Args = {std::unique_ptr<int, std::default_delete<int> >}; Time = std::chrono::duration<long int, std::ratio<1, 1000000> >; Clock = std::chrono::_V2::system_clock]':
prog.cc:35:55:   required from here
prog.cc:18:20: error: no matching function for call to 'invoke(void (&)(std::unique_ptr<int>), std::unique_ptr<int>&)'
   18 |         std::invoke(f, args...);
      |         ~~~~~~~~~~~^~~~~~~~~~~~
In file included from prog.cc:2:
/opt/wandbox/gcc-head/include/c++/11.0.0/functional:85:5: note: candidate: 'template<class _Callable, class ... _Args> constexpr std::invoke_result_t<_Fn, _Args ...> std::invoke(_Callable&&, _Args&& ...)'
   85 |     invoke(_Callable&& __fn, _Args&&... __args)
      |     ^~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/functional:85:5: note:   template argument deduction/substitution failed:
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/ratio:39,
                 from /opt/wandbox/gcc-head/include/c++/11.0.0/chrono:39,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/type_traits: In substitution of 'template<class _Fn, class ... _Args> using invoke_result_t = typename std::invoke_result::type [with _Fn = void (&)(std::unique_ptr<int>); _Args = {std::unique_ptr<int, std::default_delete<int> >&}]':
/opt/wandbox/gcc-head/include/c++/11.0.0/functional:85:5:   required by substitution of 'template<class _Callable, class ... _Args> constexpr std::invoke_result_t<_Fn, _Args ...> std::invoke(_Callable&&, _Args&& ...) [with _Callable = void (&)(std::unique_ptr<int>); _Args = {std::unique_ptr<int, std::default_delete<int> >&}]'
prog.cc:18:20:   required from 'static Time perf_timer<Time, Clock>::duration(F&&, Args ...) [with F = void (&)(std::unique_ptr<int>); Args = {std::unique_ptr<int, std::default_delete<int> >}; Time = std::chrono::duration<long int, std::ratio<1, 1000000> >; Clock = std::chrono::_V2::system_clock]'
prog.cc:35:55:   required from here
/opt/wandbox/gcc-head/include/c++/11.0.0/type_traits:2959:11: error: no type named 'type' in 'struct std::invoke_result<void (&)(std::unique_ptr<int>), std::unique_ptr<int, std::default_delete<int> >&>'
 2959 |     using invoke_result_t = typename invoke_result<_Fn, _Args...>::type;
      |           ^~~~~~~~~~~~~~~
Exit Code:
1