Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2007-06-30 07:31:54


AlisdairM wrote:
>> Attached is the test file for a proposed new defect macro,
>> BOOST_NO_IMPLICIT_BOOL_CONVERSION.
>>
>> This identifies compilers (such as Borland) that do not always
>> convert expressions to bool as required by 5.14/5.15 and elsewhere.
>> The
>> workaround is fairly simple - detect the bad compiler and add an
>> additional static_cast<bool>( ) around the (sub)expression.
>>
>> This only really catches classes relying on the
>> convertible-to-unspecified-bool-type idiom.
>>
>> The test results I am posting have applied this workaround in a
>> number
>> of places, and obviously I would prefer to post those patches with a
>> defect macro rather than compiler (and version) specific workarounds.
>>
>>
>> Note: the tests checks all 'boolean contexts', not just the two or
>> three that fail with Borland. I don't know if this will catch any
>> other compilers.
>>
>> As ever, I am open to suggestions for a better name.

Looks fine to me, please go ahead with this,

John.


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