I know how to use iterators on a surface level, but I am trying to understand how iterators work in relation to a container class such as vector
.
According to why do we put :: (scope resoulation operator) before iterator?
std::vector
is a class template in the std namespace, which makesstd::vector<double>
a class.
std::vector<T>::iterator
is a nested type understd::vector<T>
From what I understand, the class template vector
has a member of type iterator
which it gets from the class template in #include <iterator>
.
This is confusing because when I look in http://www.cplusplus.com/reference/iterator/iterator/ there is no const_iterator
class template in #include <iterator>
that I can see?