cmcstl2 icon indicating copy to clipboard operation
cmcstl2 copied to clipboard

Use iterator_concept rather than iterator_category

Open akrzemi1 opened this issue 5 years ago • 0 comments

Iterator concepts in this library use iterator_traits<T>::iterator_category in the constraints, as in https://github.com/CaseyCarter/cmcstl2/blob/master/include/stl2/detail/iterator/concepts.hpp#L469

This is not conformant, as C++20 dictates that iterator_traits<T>::iterator_concept should be used whenever present (with a fallback to iterator_category when iterator_concept is absent); as in http://eel.is/c++draft/iterator.concept.forward#1

This is to allow defining iterators that have different category in C++17 than in C++20; like zip_iterator, which is an input iterator in C++17, but a random-access iterator in C++20 Ranges.

akrzemi1 avatar Dec 12 '19 23:12 akrzemi1