This is an archive of the discontinued LLVM Phabricator instance.

[libcxx][iterator] adds `std::ranges::next`
ClosedPublic

Authored by cjdb on May 15 2021, 6:03 PM.

Details

Summary

Implements part of P0896 'The One Ranges Proposal'.
Implements [range.iter.op.next].

Depends on D101922.

Diff Detail

Event Timeline

cjdb created this revision.May 15 2021, 6:03 PM
cjdb requested review of this revision.May 15 2021, 6:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2021, 6:03 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne requested changes to this revision.May 25 2021, 12:54 PM

You need to mark it [[nodiscard]] as an extension in the synopsis in <iterator>.

libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/next.pass.cpp
13 ↗(On Diff #345658)

Normally, we have one test file per overload. I know this slipped through for most ranges reviews so far, but it would be good to do it.

67 ↗(On Diff #345658)

Drop [[nodiscard]] from the tests please!

libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/next.verify.cpp
1 ↗(On Diff #345658)

The nodiscard part should be in libcxx/test/libcxx since it's an extension.

This revision now requires changes to proceed.May 25 2021, 12:54 PM
cjdb updated this revision to Diff 347842.May 25 2021, 9:46 PM
cjdb marked 3 inline comments as done.

Applies @ldionne's feedback:

  • removes [[nodiscard]] from ranges::next (per offline discussion: things not explicitly marked [[nodiscard]] in the wording to be on hold till after P2351R0 and P2377R0 are discussed in Library Evolution)
  • removes [[nodiscard]] from tests
  • splits single next.pass.cpp into four files, one for each overload
ldionne accepted this revision.May 26 2021, 4:05 PM
This revision is now accepted and ready to land.May 26 2021, 4:05 PM
cjdb updated this revision to Diff 348141.May 26 2021, 6:34 PM

rebases to see if CI started working properly

This revision was automatically updated to reflect the committed changes.