libstdc++ debug mode ideas 3
Doug Gregor
dgregor@apple.com
Mon Aug 11 23:10:00 GMT 2003
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
More information about the Libstdc++
mailing list