Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use iterator_concept rather than iterator_category #349

Open
akrzemi1 opened this issue Dec 12, 2019 · 0 comments
Open

Use iterator_concept rather than iterator_category #349

akrzemi1 opened this issue Dec 12, 2019 · 0 comments

Comments

@akrzemi1
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant