Multiple ChoiceHard 45s
noexcept and vector reallocation
Why does std::vector use move constructors during reallocation only when they are noexcept?
Options
- 1A throwing move could break the strong exception guarantee; it copies instead
- 2Move constructors are always slower than copies in the library
- 3noexcept disables the move constructor, forcing copies instead
- 4Copies are deprecated, so moves are used whenever declared
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.