[libcxx-commits] [PATCH] D141699: [libc++][ranges] Implement P2474R2(`views::repeat`).
Yurong via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue May 30 08:47:33 PDT 2023
yronglin marked an inline comment as done.
yronglin added inline comments.
================
Comment at: libcxx/include/__ranges/repeat_view.h:138
+// [range.repeat.iterator]
+template <copy_constructible _Tp, semiregular _Bound>
+ requires(is_object_v<_Tp> && same_as<_Tp, remove_cv_t<_Tp>> &&
----------------
yronglin wrote:
> philnik wrote:
> > yronglin wrote:
> > > philnik wrote:
> > > > Please add a regression test!
> > > > Please add a regression test!
> > >
> > > I think here is `copy_constructible`, not `move_constructible` ?
> > > ```
> > > template<copy_constructible W, semiregular Bound = unreachable_sentinel_t>
> > > requires is-integer-like<Bound> || same_as<Bound, unreachable_sentinel_t>
> > > class repeat_view<W, Bound>::iterator {
> > > private:
> > > ......
> > > };
> > > ```
> > >
> > > https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2474r2.html#wording-range.repeat.iterator
> > The working draft uses `move_constructible`: http://eel.is/c++draft/range.repeat#iterator. Could you look into when this changed and apply the changes to your patch?
> Seems P2492R2 (https://open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2494r2.html) introduce this change, I will apply this changes to this patch later. BTW, should we replace copyable_box with movable_box in this patch(or impl in a sperate patch)?
I have submitted a separate patch D151629 to implement P2492R2.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141699/new/
https://reviews.llvm.org/D141699
More information about the libcxx-commits
mailing list