4 ms·
Achieving exception safety while copying containers, specifically, is generally simple because their states tend to be very easy to reason about. For example, m
by nly 4y ago
Achieving exception safety while copying containers, specifically, is generally simple because their states tend to be very easy to reason about. For example, making sure you destroy elements 0 thru [n-1] in a vector if inserting element [n] in to it fails.
Move, and thus swap (since it's 3 moves), should essentially always be noexcept (never throw)