Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-02-16 09:36:09

"Peter Dimov" <pdimov_at_[hidden]> writes:

> David Abrahams wrote:
>> "Joe Gottman" <jgottman_at_[hidden]> 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

Agreed. There's no good reason to try to "fix" broken classes.

> and that optional<T>::operator= should just mirror the exception
> safety guarantee of T::operator= and T::T( T const & ).

Sounds fine to me.

Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at