I can assign a lambda function to a constexpr
variable:
static constexpr auto f = []() {return 0;};
When I want to evaluate the function in a constexpr
, the compiler complains that only constexpr functions can be used:
static auto constexpr i = f();
How can a define constexpr
lambda?