Boost logo

Boost :

Subject: Re: [boost] [thread] using Boost.Thread with move-only arguments
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2013-04-08 02:15:28


Le 08/04/13 01:37, Fernando Pelliccioni a écrit :
> El abr 7, 2013 8:17 PM, "Vicente J. Botet Escriba" <vicente.botet_at_[hidden]>
> escribió:
>> Le 08/04/13 00:59, Fernando Pelliccioni a écrit :
>>>
>>>
>>> The error occurs in
>>> boost/thread/detail/thread.hpp
>>> line 389
>>> Trunk revision 83652
>>>
>>> template <class F,class A1>
>>> thread(F f,A1 a1,typename
>>> disable_if<boost::thread_detail::is_convertible<F&,thread_attributes >,
>>> dummy* >::type=0):
>>> line 389:
>>> thread_info(make_thread_info(boost::bind(boost::type<void>(),f,a1)))
>>> {
>>> start_thread();
>>> }
>>>
>>>
>>> parameter a1 is not a BOOST_THREAD_RV_REF(A1) and is not moved.
>>>
>>> I think it should be:
>>>
>>> template <class F,class A1>
>>> thread(F f, BOOST_THREAD_RV_REF(A1) a1,typename
>>> disable_if<boost::thread_detail::is_convertible<F&,thread_attributes >,
>>> dummy* >::type=0):
>>> line 389:
>>> thread_info(make_thread_info(boost::bind(boost::type<void>(),f,
>>> boost::move(a1) )))
>>> {
>>> start_thread();
>>> }
>>>
>>> But in this case the error will occur within Boost.Bind
>>>
>>>
>> With which compiler?
>>
>>
> MinGW - GCC 4.7.1
> MinGW - GCC 4.7.2
>
>

Yes, the current implementation works only when

     ! defined(BOOST_NO_SFINAE_EXPR) && \
     ! defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \
     ! defined(BOOST_NO_CXX11_DECLTYPE) && \
     ! defined(BOOST_NO_CXX11_DECLTYPE_N3276) && \
     ! defined(BOOST_NO_CXX11_AUTO) && \
     ! defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \
     ! defined(BOOST_NO_CXX11_HDR_TUPLE)

Let me know if I can help you with Boost.bind. BTW, I needs just an
implementation of invoke (see boost/thread/detail/invoke.hpp) and result_of.

Sorry for over-quoting lastly.
Vicente


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