I am writing a random access container in C ++. I use this in my code (well, in my real code I use all types of Allocator typedefs, this is easier to understand):
template<typename T, typename Allocator = std::allocator<T> > class Carray { public:
But I can also create another iterator class derived from std::iterator . This will add support for typedefs ( it::iterator_category , it::difference_type , etc.).
Now my question is, is there any overhead using an iterator class instead of a raw pointer? If so, how significant is this overhead and is it enough not to use the iterator class?
source share