What these comments say that
template <typename T, ...> class vector { public: typedef T* iterator; typedef const T* const_iterator; ... private: T* elems;
. Similarly, a custom container designed for use with std::
algorithms can do this. Then, when the template requests Container::iterator
, it returns to this T*
instance and behaves correctly.
Therefore, the standard requires that vector
has a definition for vector::iterator
, and you use it in your code. On one platform, it is implemented as a pointer to an array, but on another platform it is something else. The important thing is that all this behaves the same in all aspects that the standard specifies.
source share