|
1431 | 1431 | \end{itemize} |
1432 | 1432 |
|
1433 | 1433 | \pnum |
| 1434 | +\recommended |
| 1435 | +The implementaton of an algorithm on a weakly incrementable type |
| 1436 | +should never attempt to pass through the same incrementable value twice; |
| 1437 | +such an algorithm should be a single-pass algorithm. |
1434 | 1438 | \begin{note} |
1435 | 1439 | For \libconcept{weakly_incrementable} types, \tcode{a} equals \tcode{b} does not imply that \tcode{++a} |
1436 | 1440 | equals \tcode{++b}. (Equality does not guarantee the substitution property or referential |
1437 | | -transparency.) Algorithms on weakly incrementable types should never attempt to pass |
1438 | | -through the same incrementable value twice. They should be single-pass algorithms. These algorithms |
| 1441 | +transparency.) |
| 1442 | +Such algorithms |
1439 | 1443 | can be used with istreams as the source of the input data through the \tcode{istream_iterator} class |
1440 | 1444 | template. |
1441 | 1445 | \end{note} |
|
1663 | 1667 | \end{codeblock} |
1664 | 1668 |
|
1665 | 1669 | \pnum |
1666 | | -\begin{note} |
1667 | | -Algorithms on output iterators should never attempt to pass through the same iterator twice. |
1668 | | -They should be single-pass algorithms. |
1669 | | -\end{note} |
| 1670 | +\recommended |
| 1671 | +The implementation of an algorithm on output iterators |
| 1672 | +should never attempt to pass through the same iterator twice; |
| 1673 | +such an algorithm should be a single-pass algorithm. |
1670 | 1674 |
|
1671 | 1675 | \rSec3[iterator.concept.forward]{Concept \cname{forward_iterator}} |
1672 | 1676 |
|
|
2009 | 2013 | \end{libreqtab4b} |
2010 | 2014 |
|
2011 | 2015 | \pnum |
| 2016 | +\recommended |
| 2017 | +The implementation of an algorithm on input iterators |
| 2018 | +should never attempt to pass through the same iterator twice; |
| 2019 | +such an algorithm should be a single pass algorithm. |
2012 | 2020 | \begin{note} |
2013 | | -For input iterators, |
2014 | | -\tcode{a == b} |
2015 | | -does not imply |
2016 | | -\tcode{++a == ++b}. |
| 2021 | +For input iterators, \tcode{a == b} does not imply \tcode{++a == ++b}. |
2017 | 2022 | (Equality does not guarantee the substitution property or referential transparency.) |
2018 | | -Algorithms on input iterators should never attempt to pass through the same iterator twice. |
2019 | | -They should be |
2020 | | -\term{single pass} |
2021 | | -algorithms. |
2022 | 2023 | Value type \tcode{T} is not required to be a \oldconcept{CopyAssignable} type (\tref{cpp17.copyassignable}). |
2023 | | -These algorithms can be used with istreams as the source of the input data through the |
| 2024 | +Such an algorithm can be used with istreams as the source of the input data through the |
2024 | 2025 | \tcode{istream_iterator} |
2025 | 2026 | class template. |
2026 | 2027 | \end{note} |
|
2070 | 2071 | \end{libreqtab4b} |
2071 | 2072 |
|
2072 | 2073 | \pnum |
| 2074 | +\recommended |
| 2075 | +The implementation of an algorithm on output iterators |
| 2076 | +should never attempt to pass through the same iterator twice; |
| 2077 | +such an algorithm should be a single-pass algorithm. |
2073 | 2078 | \begin{note} |
2074 | | -The only valid use of an |
2075 | | -\tcode{operator*} |
| 2079 | +The only valid use of an \tcode{operator*} |
2076 | 2080 | is on the left side of the assignment statement. |
2077 | 2081 | Assignment through the same value of the iterator happens only once. |
2078 | | -Algorithms on output iterators should never attempt to pass through the same iterator twice. |
2079 | | -They should be single-pass algorithms. |
2080 | 2082 | Equality and inequality might not be defined. |
2081 | 2083 | \end{note} |
2082 | 2084 |
|
|
0 commit comments