Boost logo

Boost :

Subject: Re: [boost] [thread] using Boost.Thread with move-only arguments
From: Fernando Pelliccioni (fpelliccioni_at_[hidden])
Date: 2013-04-09 20:48:45


On Mon, Apr 8, 2013 at 3:15 AM, Vicente J. Botet Escriba <
vicente.botet_at_[hidden]> wrote:

> 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)
>
>
The only unsupported feature of the list is DECLTYPE_N3276 for GCC >= 4.7

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf

! defined(BOOST_NO_CXX11_**DECLTYPE_N3276)
is not fulfilled

Are we sure that GCC 4.7 does not fulfill it? Is Boost.Config right?

I could not read N3276. Is it absolutely necessary to this requirement to
the compiler?

> 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
>
>
>
Regards,
Fernando.


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