It is possible to define your own custom iterator, by deriving from std::iterator<>.
std::iterator<>
Additional information about custom iterators