|
129 | 129 | \end{note}
|
130 | 130 |
|
131 | 131 | \pnum
|
132 |
| -Both in-place and copying versions are provided for certain algorithms.% |
133 |
| -\footnote{The decision whether to include a copying version was |
| 132 | +Both in-place and copying versions are provided for certain algorithms. |
| 133 | +\begin{footnote} |
| 134 | +The decision whether to include a copying version was |
134 | 135 | usually based on complexity considerations.
|
135 | 136 | When the cost of doing the operation dominates the cost of copy,
|
136 | 137 | the copying version is not included.
|
137 | 138 | For example, \tcode{sort_copy} is not included
|
138 | 139 | because the cost of sorting is much more significant,
|
139 |
| -and users might as well do \tcode{copy} followed by \tcode{sort}.} |
| 140 | +and users might as well do \tcode{copy} followed by \tcode{sort}. |
| 141 | +\end{footnote} |
140 | 142 | When such a version is provided for \textit{algorithm} it is called
|
141 | 143 | \textit{algorithm\tcode{_copy}}.
|
142 | 144 | Algorithms that take predicates end with the suffix \tcode{_if}
|
|
4445 | 4447 | \effects
|
4446 | 4448 | Copies elements in the range \range{first}{last}
|
4447 | 4449 | into the range \range{result - $N$}{result}
|
4448 |
| -starting from \tcode{last - 1} and proceeding to \tcode{first}.% |
4449 |
| -\footnote{\tcode{copy_backward} can be used instead of copy |
4450 |
| -when \tcode{last} is in the range \range{result - $N$}{result}.} |
| 4450 | +starting from \tcode{last - 1} and proceeding to \tcode{first}. |
| 4451 | +\begin{footnote} |
| 4452 | +\tcode{copy_backward} can be used instead of copy |
| 4453 | +when \tcode{last} is in the range \range{result - $N$}{result}. |
| 4454 | +\end{footnote} |
4451 | 4455 | For each positive integer $n \le N$,
|
4452 | 4456 | performs \tcode{*(result - $n$) = *(last - $n$)}.
|
4453 | 4457 |
|
|
4596 | 4600 | \effects
|
4597 | 4601 | Moves elements in the range \range{first}{last}
|
4598 | 4602 | into the range \range{result - $N$}{result}
|
4599 |
| -starting from \tcode{last - 1} and proceeding to \tcode{first}.% |
4600 |
| -\footnote{\tcode{move_backward} can be used instead of move |
4601 |
| -when \tcode{last} is in the range \range{result - $N$}{result}.} |
| 4603 | +starting from \tcode{last - 1} and proceeding to \tcode{first}. |
| 4604 | +\begin{footnote} |
| 4605 | +\tcode{move_backward} can be used instead of move |
| 4606 | +when \tcode{last} is in the range \range{result - $N$}{result}. |
| 4607 | +\end{footnote} |
4602 | 4608 | For each positive integer $n \le N$,
|
4603 | 4609 | performs \tcode{*(result - $n$) = $E$}.
|
4604 | 4610 |
|
|
4799 | 4805 | \begin{itemize}
|
4800 | 4806 | \item \crange{first1}{first1 + $N$},
|
4801 | 4807 | \item \crange{first2}{first2 + $N$}, and
|
4802 |
| -\item \crange{result}{result + $N$}.% |
4803 |
| -\footnote{The use of fully closed ranges is intentional.} |
| 4808 | +\item \crange{result}{result + $N$}. |
| 4809 | +\begin{footnote} |
| 4810 | +The use of fully closed ranges is intentional. |
| 4811 | +\end{footnote} |
4804 | 4812 | \end{itemize}
|
4805 | 4813 |
|
4806 | 4814 | \pnum
|
|
8451 | 8459 | \tcode{\{first, first\}} if \range{first}{last} is empty, otherwise
|
8452 | 8460 | \tcode{\{m, M\}}, where \tcode{m} is
|
8453 | 8461 | the first iterator in \range{first}{last} such that no iterator in the range refers
|
8454 |
| -to a smaller element, and where \tcode{M} is the last iterator\footnote{This behavior |
8455 |
| -intentionally differs from \tcode{max_element}.} |
| 8462 | +to a smaller element, and where \tcode{M} is the last iterator |
| 8463 | +\begin{footnote} |
| 8464 | +This behavior |
| 8465 | +intentionally differs from \tcode{max_element}. |
| 8466 | +\end{footnote} |
8456 | 8467 | in \range{first}{last} such that no iterator in the range refers to a larger element.
|
8457 | 8468 |
|
8458 | 8469 | \pnum
|
|
9033 | 9044 | and \oldconcept{CopyAssignable} (\tref{cpp17.copyassignable}) requirements.
|
9034 | 9045 | In the range \crange{first}{last},
|
9035 | 9046 | \tcode{binary_op} neither modifies elements
|
9036 |
| -nor invalidates iterators or subranges.% |
9037 |
| -\footnote{The use of fully closed ranges is intentional.} |
| 9047 | +nor invalidates iterators or subranges. |
| 9048 | +\begin{footnote} |
| 9049 | +The use of fully closed ranges is intentional. |
| 9050 | +\end{footnote} |
9038 | 9051 |
|
9039 | 9052 | \pnum
|
9040 | 9053 | \effects
|
|
9043 | 9056 | and then modifies it with
|
9044 | 9057 | \tcode{acc = std::move(acc) + *i} or
|
9045 | 9058 | \tcode{acc = binary_op(std::move(acc), *i)}
|
9046 |
| -for every iterator \tcode{i} in the range \range{first}{last} in order.% |
9047 |
| -\footnote{\tcode{accumulate} is similar |
| 9059 | +for every iterator \tcode{i} in the range \range{first}{last} in order. |
| 9060 | +\begin{footnote} |
| 9061 | +\tcode{accumulate} is similar |
9048 | 9062 | to the APL reduction operator and Common Lisp reduce function,
|
9049 | 9063 | but it avoids the difficulty of defining the result of reduction
|
9050 |
| -on an empty sequence by always requiring an initial value.} |
| 9064 | +on an empty sequence by always requiring an initial value. |
| 9065 | +\end{footnote} |
9051 | 9066 | \end{itemdescr}
|
9052 | 9067 |
|
9053 | 9068 | \rSec2[reduce]{Reduce}
|
|
9197 | 9212 | In the ranges \crange{first1}{last1} and
|
9198 | 9213 | \crange{first2}{first2 + (last1 - first1)}
|
9199 | 9214 | \tcode{binary_op1} and \tcode{binary_op2}
|
9200 |
| -neither modifies elements nor invalidates iterators or subranges.% |
9201 |
| -\footnote{The use of fully closed ranges is intentional.} |
| 9215 | +neither modifies elements nor invalidates iterators or subranges. |
| 9216 | +\begin{footnote} |
| 9217 | +The use of fully closed ranges is intentional. |
| 9218 | +\end{footnote} |
9202 | 9219 |
|
9203 | 9220 | \pnum
|
9204 | 9221 | \effects
|
|
9387 | 9404 | \expects
|
9388 | 9405 | In the ranges \crange{first}{last} and \crange{result}{result + (last - first)}
|
9389 | 9406 | \tcode{binary_op} neither modifies elements
|
9390 |
| -nor invalidates iterators or subranges.% |
9391 |
| -\footnote{The use of fully closed ranges is intentional.} |
| 9407 | +nor invalidates iterators or subranges. |
| 9408 | +\begin{footnote} |
| 9409 | +The use of fully closed ranges is intentional. |
| 9410 | +\end{footnote} |
9392 | 9411 |
|
9393 | 9412 | \pnum
|
9394 | 9413 | \effects
|
|
9889 | 9908 | For all overloads, in the ranges \crange{first}{last}
|
9890 | 9909 | and \crange{result}{result + (last - first)},
|
9891 | 9910 | \tcode{binary_op} neither modifies elements
|
9892 |
| - nor invalidate iterators or subranges.% |
9893 |
| - \footnote{The use of fully closed ranges is intentional.} |
| 9911 | + nor invalidate iterators or subranges. |
| 9912 | +\begin{footnote} |
| 9913 | +The use of fully closed ranges is intentional. |
| 9914 | +\end{footnote} |
9894 | 9915 | \end{itemize}
|
9895 | 9916 |
|
9896 | 9917 |
|
|
0 commit comments