This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: libstdc++ debug mode ideas 3
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Benjamin Kosnik <bkoz at redhat dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: 11 Aug 2003 20:04:14 -0300
- Subject: Re: libstdc++ debug mode ideas 3
- Organization: GCC Team, Red Hat
- References: <20030806142806.04fcd8a7.bkoz@redhat.com>
On Aug 6, 2003, Benjamin Kosnik <bkoz@redhat.com> wrote:
> I think a perfect template aliasing model would make the problem go
> away because we could do this:
> namespace std {
> namespace __release {
> template<typename T, typename Allocator = std::allocator<T> >
> class vector; // define release-mode vector
> }
> namespace __debug {
> template<typename T, typename Allocator = std::allocator<T> >
> class vector; // define debug-mode vector
> }
> }
We'd need such a perfect template aliasing model to enable one to
specialize templates in namespaces other than the one in which the
template was defined. Where we stand now, a number of our customers
are running into problems specializing template code that moved from
the global namespace to namespace std or __gnu_cxx. Unfortunately we
reject specializations that are not syntactically inside namespace
blocks that match that of the original declaration. I *think* this is
mandated by the Standard, which is quite unfortunate. Ideally, one
should be able to specialize templates without having to know exactly
in which namespace they were initially declared, sufficing it to be
able to find the original template decl by name lookup.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer