Boost logo

Boost :

Subject: Re: [boost] [static_assert.hpp] Add BOOST_STATIC_ASSERT_MSG?
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2011-01-27 10:04:05

Beman Dawes wrote:
> BOOST_STATIC_ASSERT predated C++0x static_assert, so it doesn't take
> advantage of static_assert's message argument when static_assert is
> available.
> It would break too much code to change BOOST_STATIC_ASSERT, but we can
> add a new macro that does take advantage of C++0x static_assert if
> available.


> + # define BOOST_STATIC_ASSERT_MSG( B, Msg ) static_assert(B, Msg)
> + #else
> + #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.

Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.

Boost list run by bdawes at, gregod at, cpdaniel at, john at