string fix & mystery

Nathan Myers ncm@cantrip.org
Fri Apr 21 19:02:00 GMT 2000


On Fri, Apr 21, 2000 at 12:13:01PM -0700, Chip Salzenberg wrote:
> According to ncm@cantrip.org:
> > The mystery is, why does the compiler not report the bug?
> 
> >  #ifdef CONSC
> >    template 
> >      C* 
> > -    S::_S_construct<S::iterator>
> > -    (S::size_type, C, const allocator<C>&);
> > +    S::_S_construct(S::size_type, C, S::allocator_type const&);
> >  #endif
> 
> Well, because there's no compiler-visible bug.  Apparently,
> allocator_type happens to be allocator<C> in all of our actual
> usages of basic_string.

That's not the mystery.  The interesting bug was that the 
spurious "S:iterator" template argument wasn't noticed.
That particular overload of S::_S_construct isn't a template.

Nathan Myers
ncm at cantrip dot org


More information about the Libstdc++ mailing list