Boost logo

Boost :

Subject: Re: [boost] [smart_ptr][thread][test] breaking change on shared_ptr operator bool.
From: Gaetano Mendola (mendola_at_[hidden])
Date: 2012-12-12 11:02:31


On 12/12/2012 14.21, Jeff Flinn wrote:
> 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();

You really like it, don't you?

Do whatever you wish but in my opinion write a !!get_thread_info();
over a more clear get_thread_info() != 0; means to immolate simplicity
over the altar of the cleverness.

Regards
Gaetano Mendola

--
http://cpp-today.blogspot.it/

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