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
C++ Macro overload
VC++. G3log timestamp formatting.
amusing overload choice
sinem çalışma
parameter pack workaround
Waiting for Multiple Objects
infix to postfix v 2.0
Default constructor - none defined
hangman
Compile time creation of class member stl container (const std::array) filled with elements.