cplusplus / cplusplus/draft

[range.reverse.overview] Improve wording

Open
#8,446 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

P3-Other
Dominant language
TeX
Stars
221
Forks
813
Avg merge
16h 4m
Merged PRs (30d)
36

Description

views::reverse is specialized for reverse_view and subrange. However, we check with:

Given a subexpression E, the expression views​::​reverse(E) is expression-equivalent to:
(2.1) If the type of E is a (possibly cv-qualified) specialization of reverse_view, ...
(2.2) Otherwise, if the type of E is cv subrange<reverse_iterator<I>, reverse_iterator<I>, K> for some iterator type I and value K of type subrange_kind, ...

This is not the wording commonly used in <ranges> to determine specialization; we usually introduce a new type T and use something like this:

Given a subexpression E, let T be remove_cvref_t<decltype((E))>. views​::​reverse(E) is expression-equivalent to:
(2.1) If T denotes reverse_view, ...
(2.2) Otherwise, if T denotes subrange<reverse_iterator<I>, reverse_iterator<I>, K> for some iterator type I and value K of type subrange_kind, ...

See [range.take.overview], [range.drop.overview], [range.as.const.overview].

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at [range.reverse.overview] and compare its specialization wording with [range.take.overview], [range.drop.overview], and [range.as.const.overview]. Done means the reverse wording consistently introduces T as remove_cvref_t<decltype((E))> and uses T to describe the reverse_view and subrange cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.