D
Denis Remezov
Deke said:I upgraded to gcc 3.4 and ran into the problem below. I don't understand
it and need to fix this quickly. Any resolutions in changing to code
will be appreciated. I will research this later this week as time allows
but a quick resolution with code example will help a great deal.
Thanks
-------------
crt/crtmap.hpp:17: error: type `std::map<K, D, C,
std::allocator<std:air<const _Key, _Tp> > >
' is not derived from type `CRTMap<K, D, C>'
crt/crtmap.hpp:17: error: ISO C++ forbids declaration of `iterator' with
no type
crt/crtmap.hpp:17: error: expected `;' before "iterator"
crt/crtmap.hpp:18: error: type `std::map<K, D, C,
std::allocator<std:air<const _Key, _Tp> > >
' is not derived from type `CRTMap<K, D, C>'
crt/crtmap.hpp:18: error: ISO C++ forbids declaration of
`const_iterator' with no type
crt/crtmap.hpp:18: error: expected `;' before "const_iterator"
------
template <class K,class D,class C>
class CRTMap
{
private:
mutable std::map<K,D,C> mymap;
mutable CRTMLock MLock;
public:
typedef std::map<K,D,C>::iterator iterator; // line 17
typedef std::map<K,D,C>::const_iterator const_iterator; // line 18
It's become quite a FAQ that is not yet in The FAQ.
Must use typename with dependent type names:
typedef typename std::map<K,D,C>::iterator iterator; // line 17
typedef typename std::map<K,D,C>::const_iterator const_iterator; // line 18
(the older compiler versions were slacking on the standard)
Denis