In C++20 we got concepts for iterator categories, e.g. std::forward_iterator
corresponds to named requirement ForwardIterator.
They are not equivalent. In some (but not all) regards, the concepts are weaker:
(1) "Unlike the [ForwardIterator or stricter] requirements, the [corresponding] concept does not require dereference to return an lvalue."
(2) "Unlike the [InputIterator] requirements, the
input_iterator
concept does not requireequality_comparable
, since input iterators are typically compared with sentinels."...
The new std::ranges
algorithms seem to use the concepts to check iterator requirements.
But what about the other standard algorithms? (that existed pre-C++20)
Do they still use the same iterator requirements in C++20 as they were pre-C++20, or did the requirements for them get relaxed to match the concepts?