All challenges
Multiple ChoiceBeginner 45s

std::assume contract semantics

What is the purpose of [[assume(expr)]] in C++23?
Options
  1. 1It tells the optimizer expr is true, with no runtime check, and behavior is UB if false
  2. 2It throws std::invalid_argument at runtime whenever expr turns out to be false
  3. 3It logs a warning to stderr at runtime whenever expr turns out to be false
  4. 4It makes expr constexpr and forces it to be evaluated at compile time always

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