pair and exception safety