Boost logo

Boost :

Subject: Re: [boost] [smart_ptr][thread][test] breaking change on shared_ptr operator bool.
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2012-12-09 06:18:57


Le 08/12/12 15:20, Peter Dimov a écrit :
> Vicente J. Botet Escriba wrote:
>> Hi,
>>
>> https://svn.boost.org/trac/boost/changeset/81780 " Use explicit
>> operator bool when available; ..." introduces a breaking change on
>> shared_ptr in Boost.Thread and Boost.Test at least.
>
> What code does it break?
Code like

bool thread::joinable() const BOOST_NOEXCEPT
{
   return get_thread_info(); // COMPILE ERROR
}

which I have replaced by

bool thread::joinable() const BOOST_NOEXCEPT
{
   return get_thread_info()!=0;
}

Is there a better way?

Best,
Vicente


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