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
Overload
wcstombs_s wide string conversion with multibyte chars and locale + concatenation
seh exception in constructor memory leak
define_xml_tags
bitfields_msvc
#26
Title
_countof constexpr
Calculate sum between two numbers using for-, while-, and do-while loops
Replace all spaces in a string in C++