This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Re: [C++ PATCH] C++0x static assertions
- From: "Doug Gregor" <doug dot gregor at gmail dot com>
- To: "Gabriel Dos Reis" <gdr at integrable-solutions dot net>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 8 Nov 2006 09:05:49 -0500
- Subject: Re: Re: [C++ PATCH] C++0x static assertions
- References: <C65FB780-CA0C-4D86-8979-5B47551F4826@cs.indiana.edu> <m38ximc20b.fsf@zeus.integrable-solutions.net> <24b520d20611071917ybbf8b64u624f81b046082063@mail.gmail.com> <m3odri9ik4.fsf@zeus.integrable-solutions.net>
On 08 Nov 2006 14:25:31 +0100, Gabriel Dos Reis
<gdr@integrable-solutions.net> wrote:
"Doug Gregor" <doug.gregor@gmail.com> writes:
| On 07 Nov 2006 23:42:28 +0100, Gabriel Dos Reis
| <gdr@integrable-solutions.net> wrote:
| > Douglas Gregor <doug.gregor@gmail.com> writes:
| > could we simplify the ugliness and do without __static_assert, and
| > plain static_assert?
sorry, the above should read "use plain static_assert".
The issue is that with -std=c++98, "static_assert" is an identifier.
With -std=c++0x, "static_assert" is a keyword [*]. If we want to be
able to use static assertions in libstdc++ even when the user compiles
with -std=c++98, we can't use the "static_assert" keyword for them...
so the patch provides __static_assert as an alias. We do the same
thing with "typeof" and "__typeof" and "__typeof__" now.
If we don't care about this case, I'll eliminate the three lines of
code in the patch that implement this behavior.
Cheers,
Doug
[*] At some point, we should start warning about these cases.