
PING! ----- Original Message ----- From: "vicente.botet" <vicente.botet@wanadoo.fr> To: <boost@lists.boost.org> 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