Anonymous function: Difference between revisions

Content deleted Content added
C++ (since C++11): Already possible
m C++ (since C++11): Explicitly show that the lambda and the function pointer have the same type
Line 708:
 
<syntaxhighlight lang="cpp">
auto a_lambda_func = [](int x) -> void { /*...*/ };
void (* func_ptr)(int) = a_lambda_func;
func_ptr(4); //calls the lambda.