Enhanced exception safety