stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek" <Travis.Vi...@roguewave.com>
Subject RE: static_assert config check
Date Wed, 11 Jun 2008 19:57:06 GMT
 

Eric Lemings wrote:
> 
>
>> Travis Vitek wrote:
>> 
>>  
>> 
>...
>> >
>> 
>> I've written an errily similar test already (pasted below)
>> 
>
>I like your test better except for two things.
>
>1. Need a static assert at file scope similar to the one in main().
>
>2. Change main() to foo().  We don't need (nor want) to run the a
>program; just compile the source file (which is when static_assert's
>are supposed to fire).
>

True on both counts.

On a related note, we already have __rw_compile_assert [see rw/_defs.h],
but it doesn't work at global or class scope.

I provided an __rw_static_assert for use with type_traits in my original
patch, but it didn't work outside of a template. I've got an updated
version that will work in all cases. I'm thinking that I should replace
the existing __rw_compile_assert with __rw_static_assert, and then
define a macro _RWSTD_STATIC_ASSERT(Cond,Mesg) that uses static_assert
if it exists, or falls back to ours as needed.

>Brad.
>

Mime
View raw message