All challenges
Multiple ChoiceBeginner 45s

NRVO vs RVO behavior

Which statement about RVO and NRVO is correct?
Options
  1. 1RVO for prvalues is mandatory in C++17; NRVO for named locals is optional but widely implemented
  2. 2Both are mandatory, so every compiler must elide prvalue and named-local returns at every level
  3. 3Both are optional, so a compiler may copy either a prvalue return or a named local return freely
  4. 4NRVO is mandatory; RVO is optional, with named-local elision guaranteed and prvalue elision left to the optimizer

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