typedef in locale_facets.h

Wolfgang Bangerth wolfgang.bangerth@iwr.uni-heidelberg.de
Mon Mar 11 06:21:00 GMT 2002


In locale_facets.h, we find:
  template<typename _CharT>
    class ctype : public __ctype_abstract_base<_CharT>
    {
    public:
      // Types:
      typedef _CharT 		  	char_type;
      typedef typename ctype::mask 	mask;

That typedef is funny (circular, not circular?), but I guess I understand
what's meant. It might be better, though, to use
__ctype_abstract_base<_CharT>::mask.

I found that, because the compiler tells me that as written, the typename
is implicitly a typename, which I understand that the `typename' keyword
is not necessary here (not allowed?)

With the appended patch, the warning goes away.
Regards
  Wolfgang

-------------------------------------------------------------------------
Wolfgang Bangerth          email: wolfgang.bangerth@iwr.uni-heidelberg.de
                             www: http://gaia.iwr.uni-heidelberg.de/~wolf


Index: locale_facets.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/locale_facets.h,v
retrieving revision 1.41
diff -c -r1.41 locale_facets.h
*** locale_facets.h	2002/02/08 12:59:49	1.41
--- locale_facets.h	2002/03/11 14:20:12
***************
*** 167,173 ****
      public:
        // Types:
        typedef _CharT 		  	char_type;
!       typedef typename ctype::mask 	mask;
  
        explicit 
        ctype(size_t __refs = 0) : __ctype_abstract_base<_CharT>(__refs) {
}
--- 167,173 ----
      public:
        // Types:
        typedef _CharT 		  	char_type;
!       typedef typename __ctype_abstract_base<_CharT>::mask 	mask;
  
        explicit 
        ctype(size_t __refs = 0) : __ctype_abstract_base<_CharT>(__refs) {
}




More information about the Libstdc++ mailing list