Boost logo

Boost :

From: Bruno Martínez Aguerre (br1_at_[hidden])
Date: 2005-02-15 15:02:57


On Tue, 15 Feb 2005 21:33:59 +0200, Peter Dimov <pdimov_at_[hidden]> wrote:

> David Abrahams wrote:
>> Jody Hagins <jody-boost-011304_at_[hidden]> writes:
>>
>>> It seems to me that implementing the
>>> canonical assignment operator would work fine...
>>>
>>>
>>> optional & operator=(optional const & rhs)
>>> {
>>> optional tmp(rhs);
>>> optional_swap(*this, tmp);
>>> return *this;
>>> }

Why not:

optional& operator=(optional rhs)
{
   optional_swap(*this, rhs);
   return *this;
}
?

Bruno


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