Boost logo

Boost :

Subject: Re: [boost] Please use BOOST_ASSERT_MSG(x, "message") instead of BOOST_ASSERT(x && "message")
From: Philipp Moeller (philipp.moeller_at_[hidden])
Date: 2012-02-24 12:17:49

Mathias Gaunard <mathias.gaunard_at_[hidden]> writes:

> Several libraries, including Boost.Array, use things like
> BOOST_ASSERT( i < N && "out of range" );
> This causes warnings with EDG-based compilers.
> It would be nice if library authors could replace this with something like
> BOOST_ASSERT_MSG( i < N, "out of range" );
> Not only will it make those warnings disappear, it will also enable
> users to use those messages more efficiently in custom assert
> handlers.
> Thank you.

Wont this silently skip the assert message in compilers that don't
support C++11 static_assert and make the error less clear in return?

Philipp Moeller

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