Compile Time Maybe

A function is marked constexpr. When is it guaranteed to be evaluated at compile time?

A

Only when compiled with optimization flags enabled

B

Always: constexpr functions are always evaluated at compile time

C

Only when the result is used in a context that requires a compile-time constant (e.g., array size, template argument, constexpr variable initialization)

D

Only when all parameters are literal types