Language
C++
Compiler
clang 6.0.1
Options
Warnings
Boost 1.68.0
C++17
no pedantic
$ clang++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.68.0/clang-6.0.1/include -std=c++17
Exit Code:
1
Author
anonymous
over 6 years ago
C++
clang 6.0.1
Author
anonymous
over 6 years ago
$ clang++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.68.0/clang-6.0.1/include -std=c++17
prog.cc:9:5: error: static_assert failed due to requirement 'std::is_invocable_r_v<int, (lambda at prog.cc:16:22), int>'
static_assert(std::is_invocable_r_v<int, x_Action, int>);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cc:16:5: note: in instantiation of function template specialization 'functor_by_value<(lambda at prog.cc:16:22)>' requested here
functor_by_value([](char const * x) {return x;}); // error
^
prog.cc:10:12: error: no matching function for call to object of type '(lambda at prog.cc:16:22)'
return action(int{1});
^~~~~~
prog.cc:16:22: note: candidate function not viable: no known conversion from 'int' to 'const char *' for 1st argument
functor_by_value([](char const * x) {return x;}); // error
^
prog.cc:16:22: note: conversion candidate of type 'const char *(*)(const char *)'
2 errors generated.