All challenges
Multiple ChoiceHard 45s

constexpr dynamic allocation requirement

In C++20 constant evaluation, if you allocate memory inside a constexpr function, what must happen for evaluation to succeed?
Options
  1. 1Nothing special; leaked allocations are simply permitted
  2. 2You must call std::free on every buffer before it returns
  3. 3Allocation is forbidden entirely inside constant evaluation
  4. 4Every allocation must be deallocated by the time evaluation ends

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