我有一个代码如:
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’
我在做错什么?