[libcxx-commits] [PATCH] D144767: [libc++][ranges] Implement P2443R1: `views::chunk_by`
Jakub Mazurkiewicz via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Apr 18 05:35:15 PDT 2023
JMazurkiewicz added inline comments.
================
Comment at: libcxx/include/__ranges/chunk_by_view.h:85
+ };
+ return ranges::prev(ranges::adjacent_find(__reversed, __reversed_pred).base(), 1, __first);
+ }
----------------
Mordante wrote:
> Is there a reason why this is written in a different fashion as in the Standard? This makes it harder to verify its correctness.
> Is there a reason why this is written in a different fashion as in the Standard?
This is based on reference implementation from P2443R1 (https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2443r1.html#pnum_16); I've only replaced `not_fn(bind(ref(*pred_), _2, _1))` with lambda expression.
================
Comment at: libcxx/include/__ranges/chunk_by_view.h:131
+class chunk_by_view<_View, _Pred>::__iterator {
+public:
+ friend chunk_by_view;
----------------
Mordante wrote:
> Is there a reason to make the exposition only type public?
No, I think that I wanted to test something here.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144767/new/
https://reviews.llvm.org/D144767
More information about the libcxx-commits
mailing list