All challenges
Multiple ChoiceIntermediate 45s

consteval vs constexpr

What does `consteval` (C++20) enforce that `constexpr` does not?
Options
  1. 1The function cannot be called at compile time, and is only usable during runtime execution.
  2. 2The function must be evaluated at compile time; calling it at runtime is ill-formed.
  3. 3It is only allowed on variables and never on functions, which constexpr permits both of.
  4. 4It is exactly equivalent to constexpr, with the newer spelling simply preferred in C++20.

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle