[libcxx-commits] [PATCH] D103335: [libcxx][ranges] Adds `common_iterator`.

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 8 17:04:23 PDT 2021


zoecarver marked 3 inline comments as done.
zoecarver added inline comments.


================
Comment at: libcxx/include/__iterator/common_iterator.h:115
+    } else if constexpr (requires (_Iter& __i) { { *__i++ } -> __referenceable; } ||
+                         !constructible_from<iter_value_t<_Iter>, iter_reference_t<_Iter>>) {
+      return __u.__iter++;
----------------
zoecarver wrote:
> ldionne wrote:
> > http://eel.is/c++draft/iterators.common#common.iter.nav-5 says:
> > 
> > > Otherwise, if `requires (I& i) { { *i++ } -> can-reference; }` is `true` or `constructible_­from<iter_­value_­t<I>, iter_­reference_­t<I>> && move_­constructible<iter_­value_­t<I>>` is `false`, equivalent to: `return get<I>(v_)++;`
> > 
> > We're missing `&& move_constructible<...>` here?
> Good catch. It looks like this was recently changed.
OK I added a test, but I'd like someone to verify it's correct. See my other comment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103335



More information about the libcxx-commits mailing list