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

Stephen Kelly steveire at gmail.com
Wed Jun 20 02:27:36 PDT 2012


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.

Adding the line number might be a good idea though indeed.

Thanks,

Steve.





More information about the cfe-dev mailing list