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

Tim Song via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 13 21:55:50 PDT 2021


tcanens added inline comments.


================
Comment at: libcxx/include/__iterator/common_iterator.h:97
+    // Otherwise replace with the oposite element.
+    else if (__idx == 0)
+      __hold_.template emplace<1>(__unchecked_get<1>(__other.__hold_));
----------------
These should look at `__other_idx` - this assignment is valid even if `*this` is valueless.


================
Comment at: libcxx/include/__iterator/common_iterator.h:272-274
+  using pointer = conditional_t<__common_iter_has_ptr_op<_Iter, _Sent>,
+                                typename __arrow_type_or_void<_Iter, _Sent>::type,
+                                void>;
----------------
This `conditional_t` seems unnecessary?


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