[libcxx-commits] [PATCH] D106507: [libcxx][ranges] Add ranges::take_view.

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 22 14:06:34 PDT 2021


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


================
Comment at: libcxx/include/__ranges/take_view.h:154
+    friend constexpr bool operator==(const _Iter<_Const>& __lhs, const __sentinel& __rhs) {
+      return __lhs.count() == 0 || __lhs.base() == __rhs.base();
+    }
----------------
ldionne wrote:
> You could use `__rhs.__end_` here, which would avoid making a copy of the sentinel (`base()` makes a copy). Same applies above.
That really //should// be inlined. But fair enough. I'm going to make it public so I can do that for lhs too. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106507



More information about the libcxx-commits mailing list