Skip to content

[iterator.requirements.general,range.counted] Rework notation for cou… #3603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions source/iterators.tex
Original file line number Diff line number Diff line change
Expand Up @@ -620,15 +620,15 @@
\range{i}{s} denotes a valid range.

\pnum
A \defnadj{counted}{range} \range{i}{n} is empty if \tcode{n == 0};
otherwise, \range{i}{n} refers to
A \defnadj{counted}{range} \countedrange{i}{n} is empty if \tcode{n == 0};
otherwise, \countedrange{i}{n} refers to
the \tcode{n} elements in the data structure
starting with the element pointed to by \tcode{i} and up to but not including
the element, if any, pointed to by
the result of \tcode{n} applications of \tcode{++i}.
A counted range \range{i}{n} is valid if and only if \tcode{n == 0};
A counted range \countedrange{i}{n} is valid if and only if \tcode{n == 0};
or \tcode{n} is positive, \tcode{i} is dereferenceable,
and \range{++i}{-{-}n} is valid.
and \countedrange{++i}{-{-}n} is valid.

\pnum
The result of the application of library functions
Expand Down
1 change: 1 addition & 0 deletions source/macros.tex
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@
\newcommand{\brange}[2]{\Range{(}{]}{#1}{#2}}
\newcommand{\orange}[2]{\Range{(}{)}{#1}{#2}}
\newcommand{\range}[2]{\Range{[}{)}{#1}{#2}}
\newcommand{\countedrange}[2]{$\tcode{#1} + \range{0}{#2}$}

%% Change descriptions
\newcommand{\diffhead}[1]{\textbf{#1:}\space}
Expand Down
3 changes: 2 additions & 1 deletion source/ranges.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5719,8 +5719,9 @@
\rSec2[range.counted]{Counted view}

\pnum
\indextext{range!counted}%
A counted view presents a \libconcept{view} of the elements
of the counted range\iref{iterator.requirements.general} \range{i}{n}
of the counted range\iref{iterator.requirements.general} \countedrange{i}{n}
for some iterator \tcode{i} and non-negative integer \tcode{n}.

\pnum
Expand Down