Make Our Iterators Compatible with STL Iterator Traits

Learn to make our iterators compatible with STL iterator traits.

We'll cover the following

Many STL algorithms require iterators to conform to certain traits. Unfortunately, these requirements are inconsistent across compilers, systems, and C++ versions.

For our purposes, we'll use the class from the Create an Iterable Range recipe to illustrate the issue. You may find this makes more sense if you read that recipe before continuing.

In main(), if we add a call to the minmax_element() algorithm:

Get hands-on with 1200+ tech skills courses.