Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-02-15 15:18:50


Bruno Martínez Aguerre wrote:
>
> Why not:
>
> optional& operator=(optional rhs)
> {
> optional_swap(*this, rhs);
> return *this;
> }
> ?

Because this encodes an implementation detail (that copy+swap is being used)
in the signature of operator=.


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