[libcxx-commits] [PATCH] D151629: [libc++][ranges] Implement P2494R2 (Relaxing range adaptors to allow for move only types)

Yurong via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 8 09:18:31 PDT 2023


yronglin updated this revision to Diff 529625.
yronglin added a comment.

Undo format changes and add tests for move only types.

The header file was not renamed, and still `__copyable_box.h`, this makes the review more convenient, I will rename files and dirs after reviews done or in a separate patch.

Due to the words in P2494R2, I haven't add new test for `drop_while_view`, `take_while_view` and `filter_view`, because these views has the requirement that the predicate is an `indirect_unary_predicate`, which requires that the predicate is `copy_constructible`, so they still can't accept move only types as predicate.

  [P2483R0] also suggests future work to relax the requirements on the predicate types stored by standard views. This paper does not perform this relaxation, as the copy constructibility requirement is enshrined in the indirect callable concepts ([indirectcallable.indirectinvocable]). Thus, while this paper modifies the views that currently use copyable-box for user provided predicates, it only does so to apply the rename of the exposition-only type to movable-box; it does not change any of the constraints on those views. It does, however, relax the requirements on invocables accepted by the transform family of views, because those are not constrained using the indirect callable concepts.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151629

Files:
  libcxx/docs/Status/Cxx23Papers.csv
  libcxx/include/__ranges/copyable_box.h
  libcxx/include/__ranges/drop_while_view.h
  libcxx/include/__ranges/filter_view.h
  libcxx/include/__ranges/single_view.h
  libcxx/include/__ranges/take_while_view.h
  libcxx/include/__ranges/transform_view.h
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/arrow.pass.cpp
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/assign.copy.pass.cpp
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/assign.move.pass.cpp
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/ctor.default.pass.cpp
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/ctor.in_place.pass.cpp
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/deref.pass.cpp
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/has_value.pass.cpp
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/no_unique_address.pass.cpp
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/properties.compile.pass.cpp
  libcxx/test/libcxx/ranges/range.adaptors/range.copy.wrap/types.h
  libcxx/test/std/ranges/range.adaptors/range.filter/constraints.compile.pass.cpp
  libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp
  libcxx/test/std/ranges/range.factories/range.single.view/cpo.pass.cpp
  libcxx/utils/generate_feature_test_macro_components.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151629.529625.patch
Type: text/x-patch
Size: 29383 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230608/0e42f3cc/attachment-0001.bin>


More information about the libcxx-commits mailing list