Boost logo

Boost :

From: Kevlin Henney (kevlin_at_[hidden])
Date: 2000-03-07 14:30:58


In message <Pine.LNX.4.10.10003070659430.1296-100000_at_kevins-linux>,
Kevin Atkinson <kevinatk_at_[hidden]> writes
>On Tue, 7 Mar 2000, Kevlin Henney wrote:
>> And here is one that is simpler, exception safe, but only as efficient
>> as the original version:
>>
>> template<typename T>
>> CopyPtr<T> & CopyPtr<T>::operator=(const CopyPtr & other)
>> {
>> T * old = ptr;
>> ptr = other.ptr ? new T(*other.ptr) : 0;
>> delete old;
>> return *this;
>> }
>
>How is mine not exception safe?

Sorry, this reply was meant to be against the original version, which
was not exception safe -- a failed new or ctor would lead to a garbage
pointer.
____________________________________________________________

  Kevlin Henney Without art we are nothing
  kevlin_at_[hidden] but monkeys with car keys
  kevlin_at_[hidden]
____________________________________________________________


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk