Boost logo

Boost :

Subject: Re: [boost] [smart_ptr][thread][test] breaking change on shared_ptr operator bool.
From: Jeff Flinn (Jeffrey.Flinn_at_[hidden])
Date: 2012-12-12 08:21:38


On 12/12/2012 2:46 AM, Gaetano Mendola wrote:
> On 12/12/2012 00.45, Olaf van der Spek wrote:
>> On Wed, Dec 12, 2012 at 12:40 AM, Gaetano Mendola <mendola_at_[hidden]>
>> wrote:
>>> That's horrible.
>>
>> What's wrong with it?
>> Can't we have somewhat more constructive posts. This isn't Twitter... ;)
>> It's quite a simple idiom to get a bool from an expression.
>
> You don't need to get a bool from an expression there, you need to
> return true if the thread is joinable so a
>
> return get_thread_info() != 0;
>
> will do the job.

So does:

return !!get_thread_info();

Jeff


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