4

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 :)

1
  • 2
    Sidenote: The singular is vertex, the plural vertices or vertexes. Commented Sep 23, 2010 at 13:18

1 Answer 1

17

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.