Boost logo

Boost Users :

Subject: Re: [Boost-users] problems with Boost.Thread on VS10
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2012-04-09 14:06:14


On Mon, Apr 9, 2012 at 10:41 AM, Vicente J. Botet Escriba <
vicente.botet_at_[hidden]> wrote:

> Le 08/04/12 17:18, Jeffrey Lee Hellrung, Jr. a écrit :
>
> On Sun, Apr 8, 2012 at 5:46 AM, Vicente J. Botet Escriba <
> vicente.botet_at_[hidden]> wrote:
>
>> Le 07/04/12 11:11, John M. Dlugosz a écrit :
>>
>>> On 4/6/2012 11:59 AM, Vicente J. Botet Escriba wrote:
>>>
>>>> As you are using std::move, &&, ... why not using directly the C++11
>>>> Thread library
>>>> provided with the compiler?
>>>>
>>>
>>> 1) VS10 has && and std::move, but does not have the C++11 threading
>>> library.
>>> 1b) A naive implementation (just starts a new OS thread) is not wanted.
>>> 1c) but, an overly heavy implementation is not wanted either (i.e VS11
>>> beta), because of additional dependencies in the program to distribute.
>>> 2) In the final code, the && will be optional, to avoid copies on
>>> compilers that support it, but must work with compilers that don't.
>>> 3) I need to preserve semantics of the code I'm replacing with modern
>>> C++ forms.
>>>
>> OK, I see.
>>
>>>
>>>
>>>> BTW, Boost.Thread could not implement async using Boost, as
>>>> Boost.Tuple, Boost.Bind
>>>> Boost.Fusion (Tuple) because these libraries dont manage with rvalue
>>>> references.
>>>>
>>>
>>> I don't understand how that applies to my compiler problem. It's
>>> telling me that
>>>
>>> task_object(F const& f_); // << refers to look here
>>> task_object(F&& f_); // <<<< Error here
>>>
>>> are not a valid overloading set and instead conflict.
>>>
>>> Sorry, I misunderstood your message.
>>
>> After applying the following patch your example compiles. Please could
>> you try it?
>>
>> Could you also add a Trac ticket so that this is tracked?
>>
>> HTH,
>> Vicente
>>
>
> Vicente,
>
> It looks like you're just removing the task_object::task_object(F const &)
> overload. Seems strange that this overload existed but was/is never
> actually suppose to be used. ...except when F is a function pointer, I
> guess???
>
> I sent a message to the list recently observing that one problem was the
> binding of F to be an lvalue reference (according to the error message,
> AFAICS), meaning that "F const &" and "F&&" are exactly the same type.
> Perhaps this behavior should be addressed directly?
>
>
>
> After the commit some error have appeared on the regression test (see
> below). It seems that the rvalue reference semantic has changed a lot for
> gcc. I will try to use the last design for this compiler version. Then I'll
> see what needs to be done for other compilers as soon as results appear on
> the regression tests page.
>

TBH, I wasn't really sure exactly what problem you were trying to address
with that patch, and how it addressed that :/ Care to recap?

Note that I think we have 2 threads here on Boost.Thread, one regarding VS
2010 and one regarding Sun. I might be getting them confused.

[snip gcc errors]

- Jeff



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