Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

about 6 years ago

Language

C++

Compiler

gcc 8.2.0

Options
Warnings
Don't Use Boost
C++11
no pedantic

Author

anonymous

about 6 years ago

$ g++ prog.cc -Wall -Wextra -std=c++11
prog.cc: In function 'int main()':
prog.cc:22:59: error: cannot convert 'main()::<lambda(int)>' to 'void (*)(int)'
     callWith10([=](int x) { std::cout << x << std::endl; });
                                                           ^
prog.cc:3:24: note:   initializing argument 1 of 'void callWith10(void (*)(int))'
 void callWith10(void(* bar)(int))
                 ~~~~~~~^~~~~~~~~
Exit Code:
1