Question.13
A developer writes a constexpr lambda:
constexpr
constexpr auto square = [](int x) { return x * x; }; constexpr int val = square(5); static_assert(val == 25, "Must be 25");
When is square(5) evaluated?
square(5)
Select Answer
At runtime
At compile time -- constexpr lambdas can be evaluated during compilation; the result (25) is stored as a literal in the binary
At link time
Compilation error -- lambdas cannot be constexpr