...

/

`std::iterator` Is Deprecated

`std::iterator` Is Deprecated

In C++17 you must not derive from `std::iterator`. Instead it requires you to write the trait `typedefs` explicitly.

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 iterator
  • value_type - type stored in the iterator
  • difference_type - the type that is the result of subtracting two iterators
  • pointer - pointer type of the stored type
  • reference - the reference type of the stored type

iterator_category must be one of ...