Beman Dawes wrote:
John Maddock wrote:
... As you can see, it fails at line 3 as it should, while not complaining about line 2. It will not complain about any old-style-cast either. So the test was completely successful.
Hardly that successful: those error messages are awful! The whole point of BOOST_STATIC_ASSERT is to provide semi-readable error messages - at least so that you know it's a static assertion failure and not some other issue that's the problem.
I'll have another look at this when I have a chance.
static_assert seems to be one of the first C++0x features compilers are implementing. Maybe we should be working on a transition plan for BOOST_STATIC_ASSERT. Or do you already have a plan and I'm just behind the times?
There's already a hook in the implementation to the native static_assert when available, however, a new macro that accepts a message string as well as the test might well be in order :-) John.