Boost logo

Boost :

From: Sean Parent (sparent_at_[hidden])
Date: 2002-02-05 16:21:48


Thinking this through - I think I need to add to my previous list of
requirements on T for these containers.

T must provide a move constructor.

A move constructor constructs a new T from a source T, leaving the source in
an indeterminate but destructible state.

The "copy" constructor for an std::auto_ptr meets this requirement.

I don't see a way to fake a throw safe move constructor with the confines of
the current language. Ultimately it needs to construct the destination
"consuming" the source. - any non-throwing copy constructor meets the
requirements.

Sean

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

> While I thought auto_vector might be a good place to explore move
> semantics, I see no reason that auto_vector should come to a standstill
> while move semantics are worked out. But that appears to have
> happened. Thus the new thread dedicated to move...
>
> On Tuesday, February 5, 2002, at 02:52 PM, Hamish Mackenzie wrote:
>
> > template< class T >
> > void move_construct( T *destination, T &source )
> > {
> > using namespace std;
> > construct( destination );
> > move( *destination, source ); // as per previous post
> > }
>
> I'm a little concerned that this might require T to be default
> constructible. I don't think we want to have move_construct require
> that. But maybe I'm just misreading pseudo code.
>
> Also I'm not clear how a given class would plug into move_construct
> (provide its move semantics). Could you expound on that?
>
> Thanks,
> -Howard
>
>
> Info: http://www.boost.org Send unsubscribe requests to:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


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