[libcxx-commits] [PATCH] D113695: [libcxx] Implement three-way comparison for std::reverse_iterator
Mikhail Maltsev via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Nov 12 03:08:43 PST 2021
miyuki added inline comments.
================
Comment at: libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/three-way.pass.cpp:31
+ const std::reverse_iterator<ItR> r1(r);
+ ASSERT_SAME_TYPE(decltype(l1 <=> r1), std::strong_ordering);
+ assert((l1 <=> r1) == x);
----------------
Quuxplusone wrote:
> The only reason to template this on `ItL` and `ItR` is if you're going to test different iterator types. Specifically, let's test one where its comparison category is `partial_ordering`, to make sure that that comes through OK. (I wonder if `iota_view<float>::iterator` exists and if so what its comparison category is.)
> The only reason to template this on ItL and ItR is if you're going to test different iterator types.
Yes, in this case, `char *` and `const char *`.
> Specifically, let's test one where its comparison category is partial_ordering
OK, I will add such a test.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113695/new/
https://reviews.llvm.org/D113695
More information about the libcxx-commits
mailing list