[PATCH] More implicit typename fixes

Paolo Carlini pcarlini@unitus.it
Fri Dec 21 14:59:00 GMT 2001


Nathan Myers wrote:

> On Fri, Dec 21, 2001 at 10:44:29PM +0100, Paolo Carlini wrote:
> > by compiling 17_intro/headers.cc with -Wsystem-headers I spotted a few more
> > implicit typename lurking in the library.
> > ...
> > P.S. Interestingly, this time too (as already reported in
> > http://gcc.gnu.org/ml/libstdc++/2001-12/msg00327.html) I saw a spurious
> > (correct?) warning for line 169 of locale_facets.h:
> >
> >   template<typename _CharT>
> >     class ctype : public __ctype_abstract_base<_CharT>
> >     {
> >     public:
> >       // Types:
> >       typedef _CharT      char_type;
> >       typedef typename ctype::mask  mask;       <====== 169
>
> That doesn't look spurious to me.  I suspect (without looking)
> that what's wanted is
>
>       typedef typename __ctype_abstract_base<_CharT>::mask  mask;

Thanks for your feedback. In fact, as you may have noticed from my previous fix
for a similar problem in stl_rope.h, this is the kind of typedef I'm tempted to
use ;-)

However, the new parser likes also typedef typename ctype::mask  mask (checked a
moment ago). Is that legal too? I'm tempted to think so.

By the way, what's your opinion on my basic_string::insert work? For sure, when
inserting in the middle of a very long string the performance improvement is
hardly noticeable, but on the other hand it seems to me difficult ;-) to do
better and I would like to see a consistent implementation across
append-assign-insert-replace...

> BTW, does the word "_abstract_" stuck in implementation class names
> actually help anybody's comprehension?  Does it mean anything?

;-)

Cheers,
Paolo.




More information about the Libstdc++ mailing list