Page MenuHomePhabricator

[libc++] [test] The long-awaited mass refactor of "test_iterators.h" sentinels [WIP]
Needs ReviewPublic

Authored by Quuxplusone on Oct 7 2021, 6:21 PM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Summary

I did this locally as about ten commits, which might be easier to grok individually; but I'm thinking I should land it as one monolithic commit.
https://github.com/Quuxplusone/llvm-project/compare/main...bogus-operators
The goals include:

  • Rename sentinel_wrapper to just sentinel, so that now we have e.g. foo_iterator and e.g. sentinel, sized_sentinel. (This required doing some other refactors to get rid of a couple of global types named sentinel.)
  • Where appropriate, use sized_sentinel<It>, instead of using sentinel_wrapper<It>-plus-some-bogus-ad-hoc-operator-overloads.
  • Refactor sentinel and sized_sentinel to more closely resemble the existing foo_iterator archetypes, and to permit creating sentinel<cpp20_input_iterator<int*>> — iterators can be move-only, but sentinels must be copyable.
  • Opportunistically simplify some Ranges tests (but not systematically; just anything I was already touching for other reasons).

Diff Detail

Event Timeline

Quuxplusone requested review of this revision.Oct 7 2021, 6:21 PM
Quuxplusone created this revision.
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald TranscriptOct 7 2021, 6:21 PM