3

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?

Jens
  • 8,515
  • 1
  • 24
  • 39

0 Answers0