[libcxx-commits] [PATCH] D128864: [libc++] Fix algorihtms which use reverse_iterator

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 3 04:47:55 PDT 2022


Mordante added inline comments.


================
Comment at: libcxx/include/__iterator/reverse_iterator.h:337
+template <class _Iter>
+class _AlgRevIter {
+  _Iter __iter_;
----------------
I'm not really happy with this name, it doesn't tell me anything. I also would like some comment what this iterator wrapper is.


================
Comment at: libcxx/include/__iterator/reverse_iterator.h:337
+template <class _Iter>
+class _AlgRevIter {
+  _Iter __iter_;
----------------
Mordante wrote:
> I'm not really happy with this name, it doesn't tell me anything. I also would like some comment what this iterator wrapper is.
How is this class tested?


================
Comment at: libcxx/include/__iterator/reverse_iterator.h:357
+
+  _LIBCPP_HIDE_FROM_ABI constexpr auto base() const { return __iter_; }
+  _LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() {
----------------
In general we prefer not to use compiler deduced `auto` on return types.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128864



More information about the libcxx-commits mailing list