All challenges
Multiple ChoiceHard 45s

COW string status

Is copy-on-write `std::string` permitted by the current C++ standard?
Options
  1. 1Yes, and it is the default strategy in all major implementations of std::string used in production today.
  2. 2Yes, but only when the GNU libstdc++ extensions are enabled with the appropriate preprocessor macro.
  3. 3Only for strings longer than the SSO buffer, where heap storage makes sharing profitable rather than harmful.
  4. 4No — C++11 forbids it (data()/operator[] must not invalidate or require copying), though some legacy ABIs still used it.

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