Multiple ChoiceHard 45s
Difference between constinit and constexpr variables
Which statement correctly distinguishes constinit from constexpr?
Options
- 1constinit guarantees static initialization without requiring constant-destructibility, unlike constexpr
- 2constinit makes a variable immutable at runtime, whereas constexpr allows mutation after initialization
- 3constinit requires the variable to be of literal type, exactly as constexpr does for its own variables
- 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.