compile error under gcc 4.2

#include <map>
using namespace std;

template<class A,class B>
class mymap: public map<A,B>
{
size_type fun(){}
};

int main()
{
return 1;
}

compile error: size_type does not name a type.

Crazy.size_type is a inner type defined in <map>. I inherited the class map, so use it should be ok. why?
Last edited on
http://www.parashift.com/c++-faq-lite/templates.html#faq-35.18
Compiling with gcc 4.6.1
 error: ‘size_type’ does not name a type
 note: (perhaps ‘typename std::map<K, V>::size_type’ was intended)

Topic archived. No new replies allowed.