Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Error defining lambda inside namespace
#include <unordered_map> #include <string> #include <functional> #include <iostream> namespace test { struct A { static const std::unordered_map<std::string, std::function<void(const std::string &)>> a; static void call(const std::string &str) { a.at(str)(str); } }; const std::unordered_map<std::string, std::function<void(const std::string &)>> A::a { {"Hello", [](const auto &str) { std::cout << str << " World" << std::endl; } } }; } int main() { test::A::call("Hello"); return 0; }
run
|
edit
|
history
|
help
0
OS_checker
Generic EventProvider
Runner-mt
Competitive - Algorithm for max number of superior characters
MSVCStatic
hangman
get_number_of_threads, windows
Union and possible undefined behavior
No UD
Permute