我有一个像这样的代码:
namespace mymap {
template <class Key,template <typename T > class Allocator> myownmap {
typedef pair<const unsigned int, Key> typename _myPair;
typedef multimap<unsigned int, Key,less<Key> ,Allocator<_myPair> > typename _entriesType;
}
}
它在 MSVC 下成功编译(并且可以工作),但 gcc 抱怨语法无效:
.hpp:20: error: expected nested-name-specifier before ‘_myPair’
.hpp:20: error: two or more data types in declaration of ‘_myPair’
我做错了什么?