|
Boost : |
Subject: Re: [boost] [assert] static_assert envy
From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2011-01-20 18:24:55
Den 19-01-2011 17:35, Peter Dimov skrev:
> Eric Niebler wrote:
>> On 1/19/2011 8:21 AM, Steven Watanabe wrote:
>> > There's really no need to get fancy.
>> >
>> > #ifndef BOOST_DISABLE_ASSERTS
>> > if (!c1.empty() && !c2.empty()) {
>> > BOOST_ASSERT_MSG(c1.front() ? c2.front() : def_val(),
>> > "something is wrong" );
>> > }
>> > #endif
>> >
>> > works just fine.
>>
>> My thoughts exactly.
>
> Whether BOOST_ASSERTs are enabled is not solely controlled by
> BOOST_DISABLE_ASSERTS, so this is not quite correct.
which shows we don't want to write such messy code.
-Thorsten
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk