Boost logo

Boost :

Subject: Re: [boost] Futures Review - minor implementation details
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2009-01-10 08:25:52


PING!
----- Original Message -----
From: "vicente.botet" <vicente.botet_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Tuesday, January 06, 2009 11:13 PM
Subject: Re: [boost] Futures Review - minor implementation details

>
> Hi Anthony,
>
> Some minor implementation details:
> Why there is not other.future reset in
> shared_future(shared_future && other)
> {
> future.swap(other.future);
> }
> shared_future(unique_future<R> && other)
> {
> future.swap(other.future);
> }
>
> How the move is made?
>
> Is
> future.swap(other.future);
> other.future.reset();
> more efficient than
> future.reset(other.future);
> other.future.reset();
> ? Otherwise you can change it in:
>
> shared_future& operator=(shared_future && other)
> {
> future.swap(other.future);
> other.future.reset();
> return *this;
> }
> shared_future& operator=(boost::detail::thread_move_t<shared_future> other)
> {
> future.swap(other->future);
> other->future.reset();
> return *this;
> }
> shared_future& operator=(boost::detail::thread_move_t<unique_future<R> > other)
> {
> future.swap(other->future);
> other->future.reset();
> return *this;
> }
>
> And once shared_ptr implements movable you could use
> future = move(other.future);
> Isn't it?
>
> Vicente
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


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