All challenges
Multiple ChoiceHard 45s

Difference between constinit and constexpr variables

Which statement correctly distinguishes constinit from constexpr?
Options
  1. 1constinit guarantees static initialization without requiring constant-destructibility, unlike constexpr
  2. 2constinit makes a variable immutable at runtime, whereas constexpr allows mutation after initialization
  3. 3constinit requires the variable to be of literal type, exactly as constexpr does for its own variables
  4. 4constinit can be applied to functions to force their bodies to be evaluated at compile time

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