might be worth testing that if underlying iterator is already a move_iterator, this is calling the move constructor of move_iterator instead of creating a move_iterator<move_iterator<It>>
@var-const Can you make a pass at this?
Can you please add a simple test that exercises this ctad, even if it is the default-provided one by the compiler?
Do you have tests for a simple view and a non-simple view?
Do you have tests for a common range and a non-common range?
Do you have a test that would fail if you dropped the all_t here?
This [[nodiscard]] is an extension, so it should be using _LIBCPP_NODISCARD_EXT unless I am mistaken. Please make sure we have a libc++ specific test for this extension.
We might be doing it wrong for other adaptors, in which case we should also fix them, but not in this patch.
Should we be using the new facilities with meta::for_each here? (everywhere)
Any reason why this is not constexpr when it can be? (everywhere)
Please update the <ranges> synopsis as well.
This needs an include (probably currently relying on the transitive include from all.h).
I think this (an optimization, essentially) deserves a comment.
I think this check would be better in test_iterators.h, right after the definition of rvalue_iterator.
Can you also check piping a container (i.e. something that is not a view) through as_rvalue? Ideally, both lvalue and rvalue.
Nit: can you add empty lines between the cases? (Here and in some other tests)
The argument order is swapped in the comment.
Nit: return 0;.
These checks don't seem to be exhaustive. For example, there should probably be a check that !HasBegin if !range<const _View>.
This only tests the non-const version of begin, right? I think it shouldn't be too hard to also test a const as_rvalue_view here.
Optional: I think you could wrap this call in a check like if constexpr (std::sentinel_for<Iter, Iter>) and avoid having to call test_range directly from test.
Can you also test the case where the concept is false?
Is it possible to just use the std::ranges::common_range concept?
Same as the begin tests -- I think this should also test when a view is const.
Same as the begin test -- I think this can be simplified with if constexpr.
Why are we checking begin here?
Doesn't seem to be checked. Also, why is it only on the const sized view and not the non-const one?
Why is the return value only checked for the const case?
LGTM (with just a couple of minor comments). I'll leave final approval to @ldionne since he had comments as well.
We can still add a comment, even if this is essentially copied from the Standard. If I'm reading this correctly, this avoids wrapping a range in an rvalue_view if it's already a range of rvalues, to avoid unnecessary bloat. If that's correct, I think it deserves a comment.
Would std::is_convertible work?
I don't think this was addressed. Please try to ensure that you've addressed feedback before marking a comment as done, otherwise it's really easy to drop (potentially important) comments on the floor. Reviewers usually assume that the feedback has been implemented correctly when the comment is marked as done.
I would agree that no comment is needed since this is indeed what the standard specifies. I'm actually not sure what the comment would say.