Language
C++
Compiler
gcc HEAD 10.0.0 20191015 (experimental)
Options
Warnings
Boost 1.71.0
C++2a(GNU)
no pedantic
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.71.0/gcc-head/include -std=gnu++2a Exit Code:
1
Author
anonymous
about 6 years ago
C++
gcc HEAD 10.0.0 20191015 (experimental)
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:17:18: error: cannot call function 'void GetMaxValue(T&) [with T = std::vector<int>]'
17 | GetMaxValue(b); // compiler error
| ^
prog.cc:6:6: note: constraints not satisfied
6 | void GetMaxValue( T& x )
| ^~~~~~~~~~~
prog.cc: In function 'void GetMaxValue(T&) [with T = std::vector<int>]':
prog.cc:6:6: required by the constraints of 'template<class T> requires is_arithmetic_v<T> void GetMaxValue(T&)'
prog.cc:5:15: note: the expression 'is_arithmetic_v<T>' evaluated to 'false'
5 | requires std::is_arithmetic_v<T>
| ~~~~~^~~~~~~~~~~~~~~~~~
prog.cc: In instantiation of 'void GetMaxValue(T&) [with T = int]':
prog.cc:14:18: required from here
prog.cc:6:22: warning: unused parameter 'x' [-Wunused-parameter]
6 | void GetMaxValue( T& x )
| ~~~^