struct Test
{
static const int value = []() -> int { return 0; } ();
};
With gcc-4.6 I get something like, error: function needs to be constexpr
. I have tried multiple combinations of putting constexpr
at various places, but no luck.
Is constexpr
supported for lambda functions as well (irrespective of return
type specified or not) ? What is the correct syntax ?
Any work around possible ?
constexpr
lambda function be useful? It seems to me like it would only end up adding another pair of braces around the actual expression โ bdonlan__VA_ARGS__
in macro). But explaining that will be a whole new question. โ iammilind