Boost logo

Boost :

From: Rainer Deyke (root_at_[hidden])
Date: 2002-02-05 20:43:16

----- Original Message -----
From: "Howard Hinnant" <hinnant_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Tuesday, February 05, 2002 5:09 PM
Subject: Re: [boost] move semantics

> On Tuesday, February 5, 2002, at 06:49 PM, Rainer Deyke wrote:
> >> Yes, these will all work. And they are all less efficient than
> > moving
> >> elements out of the way once (directly to where they belong),
> > leaving
> >> valid elements in their place and copying x directly into place.
> >
> > While this is technically true, they are also all potentially
> > of magnitude faster than the naive copying approach. They are
> > enough to optimal that I am not sure if further optimization is
> > it.
> They are not close to optimal at all if T is a light weight class
> move semantics (like auto_ptr). In this case your alternatives are
> and 3 times slower.

No: the time needed to move 'x' is likely to be dominated by the time
needed to make room for 'x'.

Rainer Deyke | root_at_[hidden] |

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