$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [boost] [move][container] Review Request (new versionsofBoost.Move and Boost.Container in sandbox and vault)
From: Peter Dimov (pdimov_at_[hidden])
Date: 2009-09-07 17:31:54
I wrote:
> T& operator=( T&& x )
> {
> T( move(x) ).swap( *this );
> return *this;
> }
This is the generic version, but for vector, one might also consider the
equivalent of
T& operator=( T&& x )
{
T tmp( move(x) );
clear();
swap( x );
swap( tmp );
return *this;
}
to avoid deallocating the current capacity of *this.