
David Abrahams wrote:
"Joe Gottman" <jgottman@carolina.rr.com> writes:
I disagree. This may ensure the basic exception-safety guarantee, but most code that uses optional<T> will use T::operator=() at some point or other. So if T::operator=() is not exception-safe
Whoa, here we go again! You seem to be assuming
basic exception-safety guarantee == "not exception-safe."
That's just not true for any reasonable definition of "exception-safe."
No, he isn't assuming that. "Not exception safe" == "does not provide basic" in the above paragraph. Fernando's goal, IIUC, was to make optional<T>::operator= provide the basic guarantee even when T::operator= does not. We are arguing that this is not necessary and that optional<T>::operator= should just mirror the exception safety guarantee of T::operator= and T::T( T const & ).