Lifetime of lambda objects in relation to function pointer conversion
Following this answer I'm now wondering what the rules are for the lifetime of lambdas and how the relate to the lifetime of function pointers which are created by automatic conversion. There are several questions about the lifetime of lambdas (e.g. here and here ), in which case the answers are "they behave exactly like you wrote the full functor object yourself", however neither address the conversion to function pointer which could quite sensibly be a special case. I put together this small working example that illustrates my concern: #include <iostream> typedef int (*func_t)(int); // first