Simplified version of the code:
Foo.h:
class Foo {
private:
class Bar {
// ...
};
typedef std::map<int, Bar> mapType;
mapType _map;
public:
void method(mapType::iterator it);
};
Foo.cpp:
void Foo::method(mapType::iterator it) {
// ...
notMethod(it);
}
void notMethod(mapType::iterator it) {
// ...
}
Unsurprisingly, I get the error 'mapType' is not a class or namespace name
in VS2008 at notMethod
's definition. Is there any (elegant) way that I can avoid having to type out std::map<int, Bar>
everywere in notMethod
's definition without turning notMethod
into a method?