Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
decltype_lambda
#include <iostream> // In an header: inline auto wrap(int (*f)(int)) { return [f](int i) { return f(i); }; } int foo(int i); //extern decltype(wrap(&foo)) wrapped_foo; // in a cpp, the definition int foo(int i) { return i;} decltype(wrap(foo)) wrapped_foo = wrap(&foo); // and the usage: int func(){ return wrapped_foo(42); } int main() { std::cout << func() << std::endl; }
run
|
edit
|
history
|
help
0
xyz1_1 programm
std::string
IBE FT ParseFileName
Replace all spaces in a string in C++
1
Redeclare with auto
div64 inline asm
unresolved external symbol
visual-wtf
du