|
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}
|
|
8908 | 8926 | Initializes exactly $N$ elements
|
8909 | 8927 | from the results of dereferencing successive iterators of \tcode{rg},
|
8910 | 8928 | where $N$ is \tcode{ranges::distance(rg)}.
|
8911 |
| -Performs no reallocations if \tcode{R} models |
8912 |
| -\tcode{ranges::\libconcept{forward_range}} or \tcode{ranges::\libconcept{sized_range}}; |
8913 |
| -otherwise, performs order $\log N$ reallocations and |
| 8929 | + |
| 8930 | +\pnum |
| 8931 | +Performs no reallocations if: |
| 8932 | +\begin{itemize} |
| 8933 | +\item |
| 8934 | +\tcode{R} models \tcode{ranges::\libconcept{approximately_sized_range}}, and |
| 8935 | +\tcode{ranges::distance(rg) <= ranges::re\-serve_hint(rg)} is \tcode{true}, or |
| 8936 | +\item |
| 8937 | +\tcode{R} models \tcode{ranges::\libconcept{forward_range}} and |
| 8938 | +\tcode{R} does not model \tcode{ranges::approximately_sized_range}. |
| 8939 | +\end{itemize} |
| 8940 | +Otherwise, performs order $\log N$ reallocations and |
8914 | 8941 | order $N$ calls to the copy or move constructor of \tcode{T}.
|
8915 | 8942 | \end{itemdescr}
|
8916 | 8943 |
|
|
9161 | 9188 | is \tcode{true}, there are no effects.
|
9162 | 9189 | Otherwise, if an exception is thrown by the move constructor of a non-\oldconcept{CopyInsertable}
|
9163 | 9190 | \tcode{T}, the effects are unspecified.
|
| 9191 | + |
| 9192 | +\pnum |
| 9193 | +For the declarations taking a range \tcode{R}, |
| 9194 | +performs at most one reallocation if: |
| 9195 | +\begin{itemize} |
| 9196 | +\item |
| 9197 | +\tcode{R} models \tcode{ranges::\libconcept{approximately_sized_range}} and |
| 9198 | +\tcode{ranges::distance(rg) <= ranges::re\-serve_hint(rg)} is \tcode{true}, or |
| 9199 | +\item |
| 9200 | +\tcode{R} models \tcode{ranges::\libconcept{forward_range}} and |
| 9201 | +\tcode{R} does not model \tcode{ranges::\libconcept{approximately_sized_range}}. |
| 9202 | +\end{itemize} |
| 9203 | +For the declarations taking a pair of \tcode{InputIterator}, |
| 9204 | +performs at most one reallocation if |
| 9205 | +\tcode{InputItera\-tor} models \oldconcept{ForwardIterator}. |
9164 | 9206 | \end{itemdescr}
|
9165 | 9207 |
|
9166 | 9208 | \indexlibrarymember{erase}{vector}%
|
|
0 commit comments