Boost logo

Boost :

Subject: Re: [boost] [static_assert.hpp] Add BOOST_STATIC_ASSERT_MSG?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-01-27 11:40:36


AMDG

On 1/27/2011 8:26 AM, Jeff Flinn wrote:
> Stewart, Robert wrote:
>>
>>> + #ifndef BOOST_NO_STATIC_ASSERT
>>> + # define BOOST_STATIC_ASSERT_MSG( B, Msg ) static_assert(B, Msg)
>>> + #else
>>> + # define BOOST_STATIC_ASSERT_MSG( B, Msg ) BOOST_STATIC_ASSERT( B )
>>> + #endif
>>
>> The abbreviated "MSG" seems out of place. I realize
>> "BOOST_STATIC_ASSERT_MESSAGE" is very long, but it fits the pattern
>> better. I could make it even worse by suggesting that
>> "BOOST_STATIC_ASSERT_WITH_MESSAGE" would read better, particularly
>> since the message isn't being asserted.
>
> It would be nice to remain consistent boost test practice:
>
> BOOST_WARN_MESSAGE(predicate, message)
> BOOST_CHECK_MESSAGE(predicate, message)
> BOOST_REQUIRE_MESSAGE(predicate, message)
>
> BOOST_STATIC_ASSERT_MESSAGE(predicate, message)
>
> and didn't Beman just add a
>
> BOOST_ASSERT_MESSAGE(predicate, message)
>

No. He added BOOST_ASSERT_MSG.
This is consistent with BOOST_MPL_ASSERT_MSG.

In Christ,
Steven Watanabe


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