|
7839 | 7839 | \pnum |
7840 | 7840 | Let \tcode{pred} be \tcode{equal_to\{\}} |
7841 | 7841 | for the overloads with no parameter \tcode{pred}, and |
7842 | | -let $E$ be |
| 7842 | +let $E(\tcode{i})$ be |
7843 | 7843 | \begin{itemize} |
7844 | 7844 | \setlength{\emergencystretch}{1em} |
| 7845 | +\item |
| 7846 | + \tcode{false} if \tcode{i} is equal to \tcode{first}; otherwise |
7845 | 7847 | \item |
7846 | 7848 | \tcode{bool(pred(*(i - 1), *i))} |
7847 | 7849 | for the overloads in namespace \tcode{std}; |
|
7859 | 7861 |
|
7860 | 7862 | \pnum |
7861 | 7863 | \effects |
7862 | | -For a nonempty range, eliminates all but the first element |
7863 | | -from every consecutive group of equivalent elements referred to |
| 7864 | +Eliminates all elements referred to |
7864 | 7865 | by the iterator \tcode{i} in the range \range{first + 1}{last} |
7865 | | -for which $E$ is \tcode{true}. |
| 7866 | +for which $E(\tcode{i})$ is \tcode{true}. |
7866 | 7867 |
|
7867 | 7868 | \pnum |
7868 | 7869 | \returns |
|
7942 | 7943 | let $E(\tcode{i})$ be |
7943 | 7944 | \begin{itemize} |
7944 | 7945 | \setlength{\emergencystretch}{1em} |
| 7946 | +\item |
| 7947 | + \tcode{false} if \tcode{i} is equal to \tcode{first}; otherwise |
7945 | 7948 | \item |
7946 | 7949 | \tcode{bool(pred(*i, *(i - 1)))} |
7947 | 7950 | for the overloads in namespace \tcode{std}; |
|
7954 | 7957 | Let: |
7955 | 7958 | \begin{itemize} |
7956 | 7959 | \item |
7957 | | - $M$ be the number of iterators \tcode{i} in the range \range{first + 1}{last} |
| 7960 | + $M$ be the number of iterators \tcode{i} in the range \range{first}{last} |
7958 | 7961 | for which $E(\tcode{i})$ is \tcode{false}; |
7959 | 7962 | \item |
7960 | | - \tcode{result_last} be \tcode{result + $M$ + 1} |
| 7963 | + \tcode{result_last} be \tcode{result + $M$} |
7961 | 7964 | for the overloads with no parameter \tcode{result_last} or \tcode{result_r}; |
7962 | 7965 | \item |
7963 | | - $N$ be $\min(M + 1, \ \tcode{result_last - result})$. |
| 7966 | + $N$ be $\min(M, \ \tcode{result_last - result})$. |
7964 | 7967 | \end{itemize} |
7965 | 7968 |
|
7966 | 7969 | \pnum |
|
8006 | 8009 |
|
8007 | 8010 | \pnum |
8008 | 8011 | \effects |
8009 | | -Copies only the first element from $N$ consecutive groups of equivalent elements |
8010 | | -referred to by the iterator \tcode{i} in the range \range{first + 1}{last} |
8011 | | -for which $E(\tcode{i})$ holds |
| 8012 | +Copies only the first $N$ elements |
| 8013 | +referred to by the iterator \tcode{i} in the range \range{first}{last} |
| 8014 | +for which $E(\tcode{i})$ is \tcode{true} |
8012 | 8015 | into the range \range{result}{result + $N$}. |
8013 | 8016 |
|
8014 | 8017 | \pnum |
|
8020 | 8023 | \item |
8021 | 8024 | \tcode{\{last, result + $N$\}} |
8022 | 8025 | for the overloads in namespace \tcode{ranges}, |
8023 | | - if $N$ is equal to $M + 1$. |
| 8026 | + if $N$ is equal to $M$. |
8024 | 8027 | \item |
8025 | 8028 | Otherwise, \tcode{\{j, result_last\}} |
8026 | 8029 | for the overloads in namespace \tcode{ranges}, |
8027 | | - where \tcode{j} is the iterator in \range{first + 1}{last} |
| 8030 | + where \tcode{j} is the iterator in \range{first}{last} |
8028 | 8031 | for which $E(\tcode{j})$ is \tcode{false} |
8029 | | - and there are exactly $N - 1$ iterators \tcode{i} in \range{first + 1}{j} |
| 8032 | + and there are exactly $N$ iterators \tcode{i} in \range{first}{j} |
8030 | 8033 | for which $E(\tcode{i})$ is \tcode{false}. |
8031 | 8034 | \end{itemize} |
8032 | 8035 |
|
|
0 commit comments