Boost logo

Boost Users :

Subject: Re: [Boost-users] unique_future without rvalue references
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2012-05-16 04:45:25


Le 16/05/12 06:13, John M. Dlugosz a écrit :
> I'm using Clang on the Mac without the C++11 dialect enabled in this
> project.
> With BOOST_NO_RVALUE_REFERENCES defined, in Boost 1.49, how can I
> write a function returning an object of type unique_future<T> ?
> I tried changing std::move to boost::move which I expected to work. I
> tried fiddling with thread_move_t explicitly. I can't get anything to
> work.
>
> What's the magic formula?
>
>
Hi,

Boost.Thread move semantic emulation up to 1.49 has many problems. I
have reworked the move semantic interfaces adapting them to Boost.Move
in trunk (I hope it will be released for 1.50).

If you can not use the trunk,

have you tried with

boost::unique_future<T> f() {
   /// x
   return boost::detail::thread_move_t<T>(x);
}

Best,
Vicente


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net