This is my code:
typedef std::hash_multimap<Vertice<VerticeType, WeightType>*, Edge<VerticeType, WeightType>*> ght;
std::pair<ght::iterator, ght::iterator> getEdgesFromVertice(Vertice<VerticeType, WeightType>*);
When I try to compile it, it gives me an error saying:
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’
But isn't, std::hash_multimap::iterator a type? All the examples I've seen online use the same kind of notation for the return type of std::hash_multimap<T1, T2>::equal_range(key)
Any help is appreciated. Thanks :)
This looks like it is in a template and VerticeType
etc. are template parameters. In that case you are missing typename
:
std::pair<typename ght::iterator, typename ght::iterator> ...
Dependent names are assumed to not name types unless typename
is used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With