Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

about 6 years ago

Language

C++

Compiler

gcc HEAD 10.0.0 20191015 (experimental)

Options
Warnings
Boost 1.71.0
C++2a(GNU)
no pedantic

Author

anonymous

about 6 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.71.0/gcc-head/include -std=gnu++2a
prog.cc: In function 'int main()':
prog.cc:16:18: error: no matching function for call to 'GetMaxValue(std::vector<int>&)'
   16 |     GetMaxValue(b); // compiler error
      |                  ^
prog.cc:5:6: note: candidate: 'template<class T, typename std::enable_if<is_arithmetic_v<T>, int>::type <anonymous> > void GetMaxValue(T&)'
    5 | void GetMaxValue( T& x )
      |      ^~~~~~~~~~~
prog.cc:5:6: note:   template argument deduction/substitution failed:
prog.cc:4:69: error: no type named 'type' in 'struct std::enable_if<false, int>'
    4 | template <class T, std::enable_if_t<std::is_arithmetic_v<T>, int> = 0>
      |                                                                     ^
prog.cc: In instantiation of 'void GetMaxValue(T&) [with T = int; typename std::enable_if<is_arithmetic_v<T>, int>::type <anonymous> = 0]':
prog.cc:13:18:   required from here
prog.cc:5:22: warning: unused parameter 'x' [-Wunused-parameter]
    5 | void GetMaxValue( T& x )
      |                   ~~~^
Exit Code:
1