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
Not an overflow
program_solution_3
Program_1_rstring
hangman
Guess a number in c++
Triangle N5
Dynamically sized array at end of struct
std::current_exception makes a copy
Visual C++ template instantiation
error_code example