我有一段代码,类似这样:
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’
我做错了什么?
entriesPair
的定义吗? - Peter Alexandermyownmap
是什么?它是一个函数还是类? - iammilind