[libcxx-commits] [PATCH] D102639: [libcxx][ranges] Add `indirectly_movable` and `indirectly_movable_storable`.
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jun 14 13:20:05 PDT 2021
ldionne added inline comments.
================
Comment at: libcxx/test/std/iterators/iterator.requirements/alg.req.ind.move/indirectly_movable.compile.pass.cpp:26
+
+struct MoveOnlyConvertible;
+struct AssignableToMoveOnly;
----------------
This seems unused in this file.
================
Comment at: libcxx/test/std/iterators/iterator.requirements/alg.req.ind.move/indirectly_movable.compile.pass.cpp:36
+
+ MoveOnly& operator=(MoveOnlyConvertible const&) = delete;
+ MoveOnly& operator=(AssignableToMoveOnly const&);
----------------
And so does this function.
================
Comment at: libcxx/test/std/iterators/iterator.requirements/alg.req.ind.move/indirectly_movable.compile.pass.cpp:40-43
+struct MoveOnlyWrapper {
+ using value_type = MoveOnly;
+ MoveOnly& operator*() const;
+};
----------------
Suggestion:
```
template <class T>
struct PointerTo {
using value_type = T;
T& operator*() const;
};
```
Then use `PointerTo<MoveOnly>` instead of `MoveOnlyWrapper` in the tests below. I find it easier to understand that way, WDYT?
================
Comment at: libcxx/test/std/iterators/iterator.requirements/alg.req.ind.move/indirectly_movable_storable.compile.pass.cpp:142
+static_assert( std::indirectly_movable_storable<MoveOnly*, MoveOnly*>);
+static_assert( std::indirectly_movable<int*, IndirectlyMovableWithInt>);
+static_assert( std::indirectly_movable_storable<MoveOnlyWrapper, MoveOnlyWrapper>);
----------------
Should this be testing `indirectly_movable` or `indirectly_movable_storable`?
================
Comment at: libcxx/test/std/iterators/iterator.requirements/alg.req.ind.move/indirectly_movable_storable.compile.pass.cpp:144
+static_assert( std::indirectly_movable_storable<MoveOnlyWrapper, MoveOnlyWrapper>);
+static_assert( std::indirectly_movable<MoveOnlyConvertibleWrapper, MoveOnlyConvertibleWrapper>);
+static_assert(!std::indirectly_movable_storable<MoveOnlyConvertibleWrapper, MoveOnlyConvertibleWrapper>);
----------------
Same.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102639/new/
https://reviews.llvm.org/D102639
More information about the libcxx-commits
mailing list