Author
anonymous
almost 5 years ago
Language
Compiler
Options
Author
anonymous
almost 5 years ago
$
prog.cc: In function 'int main()':
prog.cc:8:31: error: no matching function for call to 'g(main()::<lambda(int)>)'
8 | g([](int x){return x + 1;});
| ^
prog.cc:3:3: note: candidate: 'template<class M> M g(std::function<M(int)>)'
3 | M g(std::function<M(int)> f) {
| ^
prog.cc:3:3: note: template argument deduction/substitution failed:
prog.cc:8:31: note: 'main()::<lambda(int)>' is not derived from 'std::function<M(int)>'
8 | g([](int x){return x + 1;});
| ^
Exit Code:
1