Help is needed

Jonathan Wakely cow@compsoc.man.ac.uk
Thu Apr 17 16:07:00 GMT 2003


On Thu, Apr 17, 2003 at 12:54:08PM -0300, Luiz Rafael Culik Guimaraes wrote:

> Dear Friends

hi

> I an code that was compiling properly with Gcc 2.95.3 Now i updated to
> gcc 3.2 and i has the follow errors  on compiling
> 
> ../../ZipString.h: In static member function `static int 
>    CZipString::zslen(const TCHAR*)':
> ../../ZipString.h:91: `string_char_traits' undeclared in namespace `std'
> ../../ZipString.h:91: parse error before `;' token
> ../../ZipString.h:91: invalid conversion from `const TCHAR*' to `int'

You probably want to use std::char_traits<char> here, not
string_char_traits. GCC 2.95 did not conform to the standard here and
you've used a non-standard type that isn't portable to other compilers.

> ./../ZipCollections.h:39: warning: `typename std::vector<TYPE, 
>    std::allocator<_CharT> >::iterator' is implicitly a typename
> ../../ZipCollections.h:39: warning: implicit typename is deprecated,
> please see 
>    the documentation for details

This means that std::vector<TYPE, std::allocator<_CharT> >::iterator
is a dependent type i.e. a type that depends on a template parameter.

Because template parameters are not known until the template is
instantiated you have to tell the compiler that you are talking about
a type. This is done with the "typename" keyword.
To get rid of the warnings put "typename" before the name of the type
(as the compiler has done in the warning messages)

hope that helps,

jon


-- 
"Doing more than skimming the XML specs would require far longer
 than I have; and they've also now fallen through my good strong
 19th century floor and killed several innocent bystanders in the
 floors below before finally coming to rest, smoking, embedded in
 the bedrock a few hundred yards under my flat."
	- Tim Bradshaw



More information about the Libstdc++ mailing list