What this C++ constexpr compilation question tests
This is an easy C++ language-knowledge question that probes your understanding of constexpr constraints and compile-time evaluation rules. Interviewers use it to confirm that you know when and how the compiler enforces strictness around constant expressions.
To solve it, you need to identify which operation or statement violates constexpr semantics—whether that's an unsupported language feature, a runtime-only dependency, or a violation of constant-expression rules. The question rewards careful reading of code and familiarity with what the compiler permits in a constant-evaluation context.
- Constexpr function evaluation and compile-time guarantees
- Operations forbidden in constant expressions
- Literal types and constexpr context rules