Boost logo

Boost :

Subject: Re: [boost] [assert] static_assert envy
From: Eric Niebler (eric_at_[hidden])
Date: 2011-01-18 12:29:41


On 1/19/2011 12:20 AM, Steven Watanabe wrote:
> On 1/18/2011 9:06 AM, Thorsten Ottosen wrote:
>> It's to avoid writing
>>
>> BOOST_ASSERT( !foo() || assertion )
>>
>> which in priciple is identical to
>>
>> if( foo() )
>> BOOST_ASSERT( assertion )
>>
>> but which is not guaranteed to be removed by the compiler, whereas
>>
>> BOOST_ASSERT_IF( foo(), assertion )
>>
>
> What exactly is wrong with
> BOOST_ASSERT( !foo() || assertion )
> or
> BOOST_ASSERT( foo() ? assertion : true )
>
> IMHO, the last thing we need is lots of
> minor variations that don't add any
> real utility.

+1

Less is more,

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

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