`std::iterator` Is Deprecated
Explore the deprecation of std::iterator in C++17 and learn how to define custom iterators by explicitly writing typedefs. This lesson helps you understand improved practices in iterator definitions that enhance code readability and reduce errors.
We'll cover the following...
We'll cover the following...
The Standard Library API requires that each iterator type has to expose five typedefs:
iterator_category- the type of the iteratorvalue_type- type stored in the iteratordifference_type- the type that is the result of subtracting two iteratorspointer- pointer type of the stored typereference- the reference type of the stored type
iterator_category must be one of ...