This is an archive of the discontinued LLVM Phabricator instance.

[libcxx][ranges] Add `ranges::reverse_view`.
ClosedPublic

Authored by zoecarver on Jul 29 2021, 12:08 PM.

Details

Reviewers
cjdb
ldionne
Group Reviewers
Restricted Project
Commits
rG9d982c67ba01: [libcxx][ranges] Add `ranges::reverse_view`.

Diff Detail

Event Timeline

zoecarver created this revision.Jul 29 2021, 12:08 PM
zoecarver requested review of this revision.Jul 29 2021, 12:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 29 2021, 12:08 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne accepted this revision.Aug 9 2021, 12:02 PM

I don't think I need to see this again after you address my comments, and have green CI. Thanks!

libcxx/include/__ranges/reverse_view.h
21–22

Not needed since we don't use min/max.

36

Per our discussion just now, could you file a bug report against Clang to ask whether this is intended: https://godbolt.org/z/bs15aq466?

37

Why not [[no_unique_address]]?

libcxx/test/std/ranges/range.adaptors/range.reverse/base.pass.cpp
43

Please comment // test with a non-common_range below, and // test with a common_range above. This applies elsewhere too - I'd like to be able to tell exactly what you're testing by just glancing at it - imagine I'm veeeery lazy.

libcxx/test/std/ranges/range.adaptors/range.reverse/begin.pass.cpp
45

Can we add a test with a random access range that is *not* a common range? We won't be caching in that case either.

83

As we just discussed, this test doesn't fail properly even if we remove the caching inside reverse_view, so that should be fixed.

libcxx/test/std/ranges/range.adaptors/range.reverse/ctor.view.pass.cpp
43

Can you test the explicit-ness by doing

static_assert( std::is_constructible_v<...>);
static_assert(!std::is_convertible_v<...>);
libcxx/test/std/ranges/range.adaptors/range.reverse/end.pass.cpp
58

This looks like a copy-paste leftover from the tests for begin (quoting yourself). Let's remove.

libcxx/test/std/ranges/range.adaptors/range.reverse/range_concept_conformance.compile.pass.cpp
25–28
This revision is now accepted and ready to land.Aug 9 2021, 12:02 PM
zoecarver marked 8 inline comments as done.Aug 9 2021, 12:50 PM
zoecarver updated this revision to Diff 365270.Aug 9 2021, 12:51 PM

Apply review comments.

This revision was landed with ongoing or failed builds.Aug 9 2021, 3:10 PM
This revision was automatically updated to reflect the committed changes.