All challenges
Multiple ChoiceIntermediate 45s

any heap allocation properties

Which is TRUE about `std::any`?
Options
  1. 1It never heap-allocates and stores every contained object inline (SBO) regardless of its size.
  2. 2It supports implicit conversions between the stored types, so any_cast is rarely needed at all.
  3. 3Small objects may be stored inline (SBO), larger ones heap-allocate; any_cast to the wrong type throws std::bad_any_cast (pointer form returns null).
  4. 4any_cast to the wrong type is undefined behavior and never throws, whether by value or pointer.

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