Why isn't a lambda that captures variables by reference convertible to a function pointer?
If I have a lambda which captures all automatic variables by reference ( [&] {} ), why can't it be converted to a function pointer? A regular function can modify variables just like a lambda that captures everything by reference can, so why is it not the same? I guess in other words, what is the functional difference between a lambda with a & capture list and a regular function such that the lambda is not convertible to a function pointer? So let's take the example of a trivial lambda: Object o; auto foo = [&]{ return o; }; What does the type of foo look like? It might look something like this