[libcxx-commits] [PATCH] D138413: [libc++] Enable segmented iterator optimizations for join_view::iterator
Hui via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Dec 3 10:11:33 PST 2022
huixie90 added inline comments.
================
Comment at: libcxx/include/__iterator/iterator_with_data.h:43
+
+ constexpr _LIBCPP_HIDE_FROM_ABI _Iterator __get_iter() { return __iter_; }
+
----------------
this can be `const`?
================
Comment at: libcxx/include/__iterator/iterator_with_data.h:45
+
+ constexpr _LIBCPP_HIDE_FROM_ABI _Data __get_data() { return std::move(__data_); }
+
----------------
do you need to `&&` qualify this member? otherwise how can we know it can be only called once
================
Comment at: libcxx/include/__iterator/iterator_with_data.h:78
+
+ constexpr _LIBCPP_HIDE_FROM_ABI iter_reference_t<_Iterator> operator*() { return *__iter_; }
+
----------------
this is a bit non-standard. Could you please briefly explain why we have a non-const operator*
================
Comment at: libcxx/include/__iterator/iterator_with_data.h:80-81
+
+ constexpr _LIBCPP_HIDE_FROM_ABI iter_reference_t<_Iterator> operator*() const { return *__iter_; }
+};
+
----------------
questions: do we need `iter_move` and `iter_swap`?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138413/new/
https://reviews.llvm.org/D138413
More information about the libcxx-commits
mailing list