This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
typedef in locale_facets.h
- From: Wolfgang Bangerth <wolfgang dot bangerth at iwr dot uni-heidelberg dot de>
- To: libstdc++ at gcc dot gnu dot org
- Date: Mon, 11 Mar 2002 15:21:12 +0100 (MET)
- Subject: typedef in locale_facets.h
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) {
}