[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-hotspot-runtime-dev
Subject:    Re: RFR: 8067306: Improve STATIC_ASSERT
From:       Kim Barrett <kim.barrett () oracle ! com>
Date:       2015-01-11 4:46:23
Message-ID: 6852A29B-808E-4C28-9142-0584E80863FD () oracle ! com
[Download RAW message or body]

On Jan 9, 2015, at 8:48 AM, Coleen Phillimore <coleen.phillimore@oracle.com> wrote:
> 
> 
> On 1/9/15, 8:45 AM, Coleen Phillimore wrote:
> > 
> > This looks like a good change.   I didn't realize we had STATIC_ASSERT.   Is \
> > there any supporting opinion to make it lower case so it doesn't scream at you in \
> > the code?

It was added a little less than two years ago, and is only used in a half dozen \
places so far. I was wanting one and was going to add it, then discovered we already \
had one, just not quite what I needed.

> Never mind. It's very macro.  It should probably stay uppercase.

Also, static_assert (lower case) is a C++11 keyword.  It’s a special operator that \
provides a similar feature, although the C++11 operator takes two arguments, the \
condition constant expression and a string literal message.  We wouldn't want to have \
to rename ours again later…

Note that our macro doesn’t have a message string because there isn’t a good way to \
get such into the compiler error message.  It might be possible to do something with \
an identifier and preprocessor token pasting if we really felt the need, but since \
its a build time failure its usually sufficient to just go look at the source line \
(hopefully) indicated in the compiler error.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic