This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: libstdc++ debug mode ideas 3


On Monday, August 11, 2003, at 4:04PM, Alexandre Oliva wrote:
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.

It is mandated by the standard. The debug mode implementation would be clean if not for this restriction :(.


Doug


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