[libc++][ranges] Implement changes to reverse_iterator from One Ranges Proposal.
authorKonstantin Varlamov <varconst@apple.com>
Fri, 18 Mar 2022 02:57:39 +0000 (19:57 -0700)
committerKonstantin Varlamov <varconst@apple.com>
Fri, 18 Mar 2022 02:58:03 +0000 (19:58 -0700)
commit658957c79afa77d306a9869ac669116e5e00109d
tree3618a147d26201fd0a2360c256b2c21532440c07
parent07998f6d750b3223199279b2ef5a48fb9bd61430
[libc++][ranges] Implement changes to reverse_iterator from One Ranges Proposal.

Changes in [P0896](https://wg21.link/p0896):
- add `disable_sized_sentinel_for`;
- add `iter_move` and `iter_swap`;
- add a `requires` clause to the `operator->`;
- add `iterator_concept`;
- check that the `Iterator` template parameter is a bidirectional
  iterator;
- add constraints to all comparison operators;
- change the definitions of `iterator_category`, `value_type`,
  `difference_type` and `reference` (changes to `iterator_category` were
  already implemented).

Also add a few forgotten things to the `reverse_iterator` synopsis
(notably the spaceship operator).

Differential Revision: https://reviews.llvm.org/D120180
14 files changed:
libcxx/docs/Status/RangesPaper.csv
libcxx/include/__iterator/iterator_traits.h
libcxx/include/__iterator/reverse_iterator.h
libcxx/include/iterator
libcxx/test/libcxx/iterators/predef.iterators/reverse.iterators/bad_template_argument.verify.cpp [new file with mode: 0644]
libcxx/test/std/iterators/predef.iterators/reverse.iterators/iterator_concept_conformance.compile.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/sfinae.compile.pass.cpp [new file with mode: 0644]
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/arrow.pass.cpp
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/arrow.sfinae.compile.pass.cpp [new file with mode: 0644]
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/iter_move.pass.cpp [new file with mode: 0644]
libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/iter_swap.pass.cpp [new file with mode: 0644]
libcxx/test/std/iterators/predef.iterators/reverse.iterators/sized_sentinel.compile.pass.cpp [new file with mode: 0644]
libcxx/test/std/iterators/predef.iterators/reverse.iterators/types.compile.pass.cpp [new file with mode: 0644]
libcxx/test/std/iterators/predef.iterators/reverse.iterators/types.pass.cpp [deleted file]