This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Help is needed
> In the meantime, put "typename" in front of the declaration.
Yesn I put, but now i get this error
../../ZipCollections.h: In member function `BOOL CZipMap<KEY,
VALUE>::Lookup(KEY, VALUE&) const':
../../ZipCollections.h:148: parse error before `;' token
../../ZipCollections.h: In member function `BOOL CZipMap<KEY,
VALUE>::Lookup(KEY, VALUE&) const [with KEY =
CZipArchive::CallbackType,
VALUE = CZipActionCallback*]':
../../ZipArchive.h:1770: instantiated from here
../../ZipCollections.h:149: `iter' undeclared (first use this function)
../../ZipCollections.h:149: (Each undeclared identifier is reported only
once
for each function it appears in.)
Reading map from Gcc c++ include files the const_iterator is defined
their as an typename
What i`m doing wrong
My .h file bellow (the part where error apear
template<class KEY, class VALUE>
class ZIP_API CZipMap : private std::map<KEY, VALUE>
{
public:
void SetAt( KEY key, VALUE newValue)
{
insert(std::map<KEY, VALUE>::value_type(key, newValue));
}
BOOL RemoveKey( KEY key )
{
return erase(key) != 0;
}
BOOL Lookup( KEY key, VALUE& rValue ) const
{
typename const_iterator iter ;
iter = find(key);
if (iter == end())
return FALSE;
else
{
rValue = iter->second;
return TRUE;
}
}
};
Regards
Luiz