[libcxx-commits] [PATCH] D157193: [libc++][ranges] P2116R9: Implements `views::enumerate`

Hristo Hristov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 19 00:42:29 PDT 2023


H-G-Hristov added inline comments.


================
Comment at: libcxx/test/std/ranges/range.adaptors/range.enumerate/iterator/base.pass.cpp:53
+    EnumerateIterator it                         = view.begin();
+    std::same_as<Iterator> decltype(auto) result = std::move(it).base();
+    assert(base(base(result)) == array.begin());
----------------
var-const wrote:
> Can we check that the iterator was moved?
@var-const I'm not sure how to check if the iterator moved. I don't seem to find an example. Could you please give me a hint.


================
Comment at: libcxx/test/std/ranges/range.adaptors/range.enumerate/iterator/subscript.pass.cpp:47
+
+    assert(std::get<0>(it[0]) == std::get<0>(*it));
+    assert(std::get<1>(it[0]) == std::get<1>(*it));
----------------
var-const wrote:
> Can you add a quick comment to explain why we can't use `assert(it[0] == *it);` here instead of `std::get`? 
I guess I wanted to be explicit. I undid that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157193/new/

https://reviews.llvm.org/D157193



More information about the libcxx-commits mailing list