Skip to content

Commit 331d1a0

Browse files
jensmaurerzygoloid
authored andcommitted
[iterator.requirements.general,range.counted] Rework notation for counted ranges.
Introduce a new macro \countedrange.
1 parent be996b3 commit 331d1a0

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

source/iterators.tex

+4-4
Original file line numberDiff line numberDiff line change
@@ -620,15 +620,15 @@
620620
\range{i}{s} denotes a valid range.
621621

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

633633
\pnum
634634
The result of the application of library functions

source/macros.tex

+1
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@
379379
\newcommand{\brange}[2]{\Range{(}{]}{#1}{#2}}
380380
\newcommand{\orange}[2]{\Range{(}{)}{#1}{#2}}
381381
\newcommand{\range}[2]{\Range{[}{)}{#1}{#2}}
382+
\newcommand{\countedrange}[2]{$\tcode{#1} + \range{0}{#2}$}
382383

383384
%% Change descriptions
384385
\newcommand{\diffhead}[1]{\textbf{#1:}\space}

source/ranges.tex

+2-1
Original file line numberDiff line numberDiff line change
@@ -5719,8 +5719,9 @@
57195719
\rSec2[range.counted]{Counted view}
57205720

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

57265727
\pnum

0 commit comments

Comments
 (0)