Language
C++
Compiler
gcc HEAD 10.0.0 20190508 (experimental)
Options
Warnings
Boost 1.70.0
C++2a(GNU)
no pedantic
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.70.0/gcc-head/include -std=gnu++2a
Exit Code:
1
Author
anonymous
about 6 years ago
C++
gcc HEAD 10.0.0 20190508 (experimental)
Author
anonymous
about 6 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.70.0/gcc-head/include -std=gnu++2a
prog.cc: In function 'int main()':
prog.cc:22:43: error: no matching function for call to 'function<not_OK_type, not_OK_pointer>()'
22 | function<not_OK_type, not_OK_pointer>();
| ^
prog.cc:18:6: note: candidate: 'template<class t__, t__ <anonymous> > void function()'
18 | void function(){}
| ^~~~~~~~
prog.cc:18:6: note: template argument deduction/substitution failed:
prog.cc:22:43: error: 'const int& (std::vector<int>::*)(size_t) const{((const int& (std::vector<int>::*)(size_t) const)std::vector<int>::operator[]), 0}' is not a valid template argument for type 'const int& (std::vector<int>::*)(long unsigned int) const'
22 | function<not_OK_type, not_OK_pointer>();
| ^
prog.cc:22:43: note: it must be a pointer-to-member of the form '&X::Y'