Question: How does this work...Vector<type>::iterator

I have looked to look all over the web and i can not find an answer, could you explain to me how it works, and how it looks in the class it would be greatly appreciated thanks :)
Last edited on
:: is the scope resolution operator. It tells you that 'iterator' is defined inside the vector<type> class.

'iterator' is a type name. Either a class, struct, or a typedef (probably a typedef).

It probably looks like this:

1
2
3
4
5
6
template <...>
class vector
{
//...
  typedef _something_ iterator;
};


For vector... _something_ is probably just T*. But it might also be a separate class. It depends on your implementation.
Oh i get it now, you are accessing it through :: and that lets you create an object out of it thanks :)
Topic archived. No new replies allowed.