|
1403 | 1403 | from \tcode{*ranges::begin(rg)}.
|
1404 | 1404 | For \tcode{vector},
|
1405 | 1405 | if \tcode{R} models
|
1406 |
| -neither \tcode{ranges::\libconcept{sized_range}} nor \tcode{ranges::\libconcept{forward_range}}, |
| 1406 | +\tcode{ranges::\libconcept{approximately_sized_range}} |
| 1407 | +but not \tcode{ranges::\libconcept{sized_range}} or models |
| 1408 | +\tcode{ranges::\libconcept{input_range}} |
| 1409 | +but not \tcode{ranges::\libconcept{forward_range}}, |
1407 | 1410 | \tcode{T} is also \oldconcept{MoveInsertable} into \tcode{X}.
|
1408 | 1411 |
|
1409 | 1412 | \pnum
|
1410 | 1413 | \effects
|
1411 | 1414 | Constructs a sequence container equal to the range \tcode{rg}.
|
1412 | 1415 | Each iterator in the range \tcode{rg} is dereferenced exactly once.
|
1413 | 1416 |
|
| 1417 | +\pnum |
| 1418 | +\recommended |
| 1419 | +If \tcode{R} models \tcode{ranges::\libconcept{approximately_sized_range}} and |
| 1420 | +\tcode{ranges::distance(\linebreak{}rg) <= ranges::reserve_hint(rg)} is \tcode{true}, |
| 1421 | +an implementation should not perform any reallocation. |
| 1422 | + |
1414 | 1423 | \pnum
|
1415 | 1424 | \ensures
|
1416 | 1425 | \tcode{distance(begin(), end()) == ranges::distance(rg)} is \tcode{true}.
|
|
1761 | 1770 | from \tcode{*ranges::begin(rg)}.
|
1762 | 1771 | For \tcode{vector},
|
1763 | 1772 | if \tcode{R} models
|
1764 |
| -neither \tcode{ranges::\libconcept{sized_range}} nor \tcode{ranges::\libconcept{forward_range}}, |
| 1773 | +\tcode{ranges::\libconcept{approximately_sized_range}} |
| 1774 | +but not \tcode{ranges::\libconcept{sized_range}} or models |
| 1775 | +\tcode{ranges::\libconcept{input_range}} |
| 1776 | +but not \tcode{ranges::\libconcept{forward_range}}, |
1765 | 1777 | \tcode{T} is also \oldconcept{MoveInsertable} into \tcode{X}.
|
1766 | 1778 | \tcode{rg} and \tcode{a} do not overlap.
|
1767 | 1779 |
|
|
1773 | 1785 | For \tcode{vector} and \tcode{deque},
|
1774 | 1786 | also invalidates the past-the-end iterator.
|
1775 | 1787 | Each iterator in the range \tcode{rg} is dereferenced exactly once.
|
| 1788 | + |
| 1789 | +\pnum |
| 1790 | +\recommended |
| 1791 | +If \tcode{R} models \tcode{ranges::\libconcept{approximately_sized_range}} and |
| 1792 | +\tcode{ranges::distance(\linebreak{}rg) <= ranges::reserve_hint(rg)} is \tcode{true}, |
| 1793 | +an implementation should not perform any reallocation. |
1776 | 1794 | \end{itemdescr}
|
1777 | 1795 |
|
1778 | 1796 | \begin{itemdecl}
|
|
8929 | 8947 | Initializes exactly $N$ elements
|
8930 | 8948 | from the results of dereferencing successive iterators of \tcode{rg},
|
8931 | 8949 | where $N$ is \tcode{ranges::distance(rg)}.
|
8932 |
| -Performs no reallocations if \tcode{R} models |
8933 |
| -\tcode{ranges::\libconcept{forward_range}} or \tcode{ranges::\libconcept{sized_range}}; |
8934 |
| -otherwise, performs order $\log N$ reallocations and |
| 8950 | + |
| 8951 | +\pnum |
| 8952 | +Performs no reallocations if: |
| 8953 | +\begin{itemize} |
| 8954 | +\item |
| 8955 | +\tcode{R} models \tcode{ranges::\libconcept{approximately_sized_range}}, and |
| 8956 | +\tcode{ranges::distance(rg) <= ranges::re\-serve_hint(rg)} is \tcode{true}, or |
| 8957 | +\item |
| 8958 | +\tcode{R} models \tcode{ranges::\libconcept{forward_range}} and |
| 8959 | +\tcode{R} does not model \tcode{ranges::approximately_sized_range}. |
| 8960 | +\end{itemize} |
| 8961 | +Otherwise, performs order $\log N$ reallocations and |
8935 | 8962 | order $N$ calls to the copy or move constructor of \tcode{T}.
|
8936 | 8963 | \end{itemdescr}
|
8937 | 8964 |
|
|
9182 | 9209 | is \tcode{true}, there are no effects.
|
9183 | 9210 | Otherwise, if an exception is thrown by the move constructor of a non-\oldconcept{CopyInsertable}
|
9184 | 9211 | \tcode{T}, the effects are unspecified.
|
| 9212 | + |
| 9213 | +\pnum |
| 9214 | +For the declarations taking a range \tcode{R}, |
| 9215 | +performs at most one reallocation if: |
| 9216 | +\begin{itemize} |
| 9217 | +\item |
| 9218 | +\tcode{R} models \tcode{ranges::\libconcept{approximately_sized_range}} and |
| 9219 | +\tcode{ranges::distance(rg) <= ranges::re\-serve_hint(rg)} is \tcode{true}, or |
| 9220 | +\item |
| 9221 | +\tcode{R} models \tcode{ranges::\libconcept{forward_range}} and |
| 9222 | +\tcode{R} does not model \tcode{ranges::\libconcept{approximately_sized_range}}. |
| 9223 | +\end{itemize} |
| 9224 | +For the declarations taking a pair of \tcode{InputIterator}, |
| 9225 | +performs at most one reallocation if |
| 9226 | +\tcode{InputItera\-tor} models \oldconcept{ForwardIterator}. |
9185 | 9227 | \end{itemdescr}
|
9186 | 9228 |
|
9187 | 9229 | \indexlibrarymember{erase}{vector}%
|
|
0 commit comments