Is it possible to use std::iterator<std::random_access_iterator_tag, const char*> as an iterator over a char array? Looking at the std::iterator definition it only has default, copy and move constructors, no T constructor. Would this mean I’d need to inherit and implement my own iterator?
Is it possible to use std::iterator<std::random_access_iterator_tag, const char*> as an iterator over a char
Share
std::iteratorcan’t help you as is. It’s true that you could inherit from it to implement your own iterator, but you can already use pointers into the array as random-access iterators.You can even use
std::beginandstd::endto get those iterators.