Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2024-04-02 15:12:23


John Maddock wrote:
> This sounds like a good thing, though no small job: in one of my idler moments
> I wondered who was still using Boost.StaticAssert - well it turns out nearly
> everyone, including some newer libraries that I'd assumed were at least C++11
> anyway.

The "problem" with StaticAssert is that BOOST_STATIC_ASSERT is still useful
in C++11 (and 14) because `static_assert` without a message is C++17.

So a simple replacement doesn't suffice and libraries generally need their local
(and trivial)

#define BOOST_LIBNAME_STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__)

Had we dropped C++03 wholesale as I proposed, we'd have been able to just
move BOOST_STATIC_ASSERT to Boost.Config with the above definition, and
leave boost/static_assert.hpp a stub header, allowing libraries to just remove
the include.

As is, though, we're still a hodgepodge of C++03 and C++11 so the above plan
won't work as is. :-)

Maybe we can have a trivial C++03 definition in Boost.Config as well? Although
looking at the various implementations in boost/static_assert.hpp, maybe not.


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