← Back to Gists

Practical lambda invoke

📝 C++
lsmith
lsmith · Level 2 ·

This snippet demonstrates how to immediately invoke a C++ lambda expression to execute a block of code inline.

C++
auto execute = []() { return 42;
}();

Comments

No comments yet. Start the discussion.