diff --git a/source/iterators.tex b/source/iterators.tex index 49e4f09bfa..e03757e018 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -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 diff --git a/source/macros.tex b/source/macros.tex index 2fa4b67169..5fd4d925d2 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -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} diff --git a/source/ranges.tex b/source/ranges.tex index 853ac4b0a9..e09c50cca8 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -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