The problem stems from your usage of a name that depends on another template which you instantiate with your template parameters.
When the compiler first encounters multimap_type::iterator
, which it knows really means multimap<Key, Val>::iterator
it cannot know if iterator
will be a type or not (after all, it does not know which instantiation of multimap
will be chosen, since it knows neither Key
nor Val
).
Knowing whether a name represents a type is important for parsing however, so the compiler takes a guess - which is "not type".
If you wish to tell the compiler that this will be a type, you have to tell it so:
typedef std::reverse_iterator<typename multimap_type::iterator> reverse_iterator;