Boost logo

Boost :

Subject: Re: [boost] Improving the assignment operators of various Boosttypes
From: David Abrahams (dave_at_[hidden])
Date: 2008-09-11 10:03:22

on Thu Sep 11 2008, Joel Falcou <> wrote:

> David Abrahams a écrit :
>> Swapping and taking the parameter by value are orthogonal issues; the
>> latter has only to do with copy elision and not with exception safety.
>> Please see this thread:
> Very interesting article. So my question is - as a teacher - what techniques
> should I teach to my student and with which justification ?

  self& operator=(self x) { swap(*this,x); return *this; }

with the rationale given in
(I suspect Andrei's CUJ article is equally good or better but much

...but I would think given the thread mentioned above that answer would
be self-evident, so it makes me wonder if you're trying to ask something

Dave Abrahams
BoostPro Computing

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