[libcxx-commits] [PATCH] D100160: [libcxx] adds `std::input_or_output_iterator` and `std::sentinel_for` to <iterator>

Michael Schellenberger Costa via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 12 22:52:55 PDT 2021


miscco added inline comments.


================
Comment at: libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.sentinel/sentinel_for.compile.pass.cpp:44-48
+struct not_semiregular {
+  not_semiregular() = delete;
+  bool operator==(std::input_or_output_iterator auto) const;
+};
+static_assert(!std::sentinel_for<not_semiregular, std::vector<int>::iterator>);
----------------
semi_regular also requires copyability (https://eel.is/c++draft/concepts.object). Please add a check that a non copyable iterator is not a sentinel for itself (aka move-only input iterators)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100160



More information about the libcxx-commits mailing list