This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: [v3] Variadic templates, third revision (3/3)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]