[cfe-dev] static_assert without C++11 and with a message?

John Bytheway jbytheway+llvm at gmail.com
Sat Jun 23 06:56:11 PDT 2012


On 20/06/12 05:27, Stephen Kelly wrote:
> Howard Hinnant wrote:
> 
>> On Jun 19, 2012, at 3:22 AM, Stephen Kelly wrote:
>>
>>>
>>> Hi there,
>>>
>>> I was looking into libc++, and noticed the implementation of
>>> static_assert for pre-c++11 compilers.
>>>
>>> Inside of the _LIBCPP_HAS_NO_STATIC_ASSERT ifdef, there is a typo (__t
>>> should be __m I presume?),
>>
>> Nope.
> 
> Ah, I see. I thought you had a clever way of getting the __m message into 
> the compile error. That's something that I find annoying in Qt because our 
> C++98 static_assert fallback doesn't contain the error.

Boost has a C++98 static assert with message, but you
have_to_make_the_message_a_valid_identifier.

<http://www.boost.org/doc/libs/1_49_0/libs/mpl/doc/refmanual/assert-msg.html>

John




More information about the cfe-dev mailing list