This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Re: [v3] Variadic templates, third revision (3/3)
- From: "Doug Gregor" <doug dot gregor at gmail dot com>
- To: "Benjamin Kosnik" <bkoz at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Mon, 6 Nov 2006 08:46:03 -0500
- Subject: Re: Re: [v3] Variadic templates, third revision (3/3)
- References: <9f71cef00611060342o19bae97ejaa5a3f63e8857d4@mail.gmail.com>
On 11/6/06, Benjamin Kosnik <bkoz@redhat.com> wrote:
My only thought is how to use the __GXX_EXPERIMENTAL_CPP0X__ macro
with the TR1 includes that have been altered. I think that this should
definitely happen.
My suggestion is to do:
#ifndef __GXX_EXPERIMENTAL_CPP0X__
#error This file makes use of experimental C++0x features, and must be
compiled with -std=gnu++0x.
#endif
At the top of
tr1/tuple
tr1/functional
Thoughts?
The compiler only complains about the use of variadic templates
outside system headers, so we're free to use variadic templates in
libstdc++; no #ifdef necessary.
However, variadic templates will change the ABI of the TR1 facilities
that use them. For example, instead of mangling "tuple<int, float>" as
"tuple<int, float, _NullClass, _NullClass, _NullClass, _NullClass,
_NullClass, _NullClass, _NullClass, _NullClass>" (which happens now),
it will mangle as "tuple<int, float>." If this is a problem we'll
either have to do what Benjamin suggests or (*shudder*) select between
the variadic and non-variadic implementations based on
__GXX_EXPERIMENTAL_CPP0X__.
Cheers,
Doug