Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ std::预期为';类型';,但我给它一个类型_C++_Templates_Stl - Fatal编程技术网

C++ std::预期为';类型';,但我给它一个类型

C++ std::预期为';类型';,但我给它一个类型,c++,templates,stl,C++,Templates,Stl,这是我的代码: typedef std::hash_multimap<Vertice<VerticeType, WeightType>*, Edge<VerticeType, WeightType>*> ght; std::pair<ght::iterator, ght::iterator> getEdgesFromVertice(Vertice<VerticeType, WeightType>*); typedef std::has

这是我的代码:

typedef std::hash_multimap<Vertice<VerticeType, WeightType>*, Edge<VerticeType, WeightType>*> ght;
std::pair<ght::iterator, ght::iterator> getEdgesFromVertice(Vertice<VerticeType, WeightType>*);
typedef std::hash_multimap ght;
std::对getEdgesFromVertice(Vertice*);
当我试图编译它时,它会给我一个错误,说:

error: type/value mismatch at argument 1 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
error:   expected a type, got ‘__gnu_cxx::hash_multimap::iterator’
错误:“模板结构std::pair”的模板参数列表中参数1的类型/值不匹配
错误:应为类型,获取了“\uu gnu\u cxx::hash\u multimap::iterator”
但是std::hash_multimap::iterator不是一种类型吗?我在网上看到的所有示例都对返回类型
std::hash\u multimap::equal\u range(key)


感谢您的帮助。谢谢:)

这看起来像是在模板中,
VerticeType
等都是模板参数。在这种情况下,您缺少
typename

std::pair<typename ght::iterator, typename ght::iterator> ...
std::pair。。。
除非使用
typename

侧注:单数是顶点,复数是顶点或顶点。