Skip to content

Commit

Permalink
LWG2033
Browse files Browse the repository at this point in the history
  • Loading branch information
sdutoit committed Feb 26, 2012
1 parent 2b07383 commit 3b28afd
Showing 1 changed file with 41 additions and 26 deletions.
67 changes: 41 additions & 26 deletions source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2934,13 +2934,14 @@

\begin{itemdescr}
\pnum
\effects If \tcode{sz <= size()}, equivalent to
\tcode{erase(begin() + sz, end());}. If \tcode{size() < sz},
\effects If \tcode{sz <= size()}, equivalent to calling
\tcode{pop_back()} \tcode{size() - sz} times.
If \tcode{size() < sz},
appends \tcode{sz - size()} value-initialized elements to the
sequence.

\pnum
\requires \tcode{T} shall be
\requires \tcode{T} shall be \tcode{MoveInsertable} into \tcode{*this} and
\tcode{DefaultConstructible}.
\end{itemdescr}

Expand All @@ -2951,18 +2952,13 @@

\begin{itemdescr}
\pnum
\effects
\begin{codeblock}
if (sz > size())
insert(end(), sz-size(), c);
else if (sz < size())
erase(begin()+sz, end());
else
; // do nothing
\end{codeblock}
\effects If \tcode{sz <= size()}, equivalent to calling
\tcode{pop_back()} \tcode{size() - sz} times. If \tcode{size() < sz},
appends \tcode{sz - size()} copies of \tcode{c} to the sequence.

\pnum
\requires \tcode{T} shall be \tcode{CopyInsertable} into \tcode{*this}.
\requires \tcode{T} shall be \tcode{MoveInsertable} into \tcode{*this} and
\tcode{CopyInsertable} into \tcode{*this}.
\end{itemdescr}

\indexlibrary{\idxcode{shrink_to_fit}!\idxcode{deque}}%
Expand All @@ -2973,7 +2969,14 @@

\begin{itemdescr}
\pnum
\remarks \tcode{shrink_to_fit} is a non-binding request to reduce memory use. \enternote The request is non-binding to allow latitude for implementation-specific optimizations. \exitnote
\requires \tcode{T} shall be \tcode{MoveInsertable} into \tcode{*this}.

\pnum
\complexity Linear in the size of the sequence.

\pnum
\remarks \tcode{shrink_to_fit} is a non-binding request to reduce memory use
but does not change the size of the sequence. \enternote The request is non-binding to allow latitude for implementation-specific optimizations. \exitnote
\end{itemdescr}

\rSec3[deque.modifiers]{\tcode{deque} modifiers}
Expand Down Expand Up @@ -4812,6 +4815,9 @@
\end{itemdecl}

\begin{itemdescr}
\pnum
\requires \tcode{T} shall be \tcode{MoveInsertable} into \tcode{*this}.

\pnum
\effects
A directive that informs a
Expand Down Expand Up @@ -4860,8 +4866,15 @@
\end{itemdecl}

\begin{itemdescr}
\pnum
\requires \tcode{T} shall be \tcode{MoveInsertable} into \tcode{*this}.

\pnum
\complexity Linear in the size of the sequence.

\pnum
\notes \tcode{shrink_to_fit} is a non-binding request to reduce \tcode{capacity()} to \tcode{size()}. \enternote The request is non-binding to allow latitude for implementation-specific optimizations. \exitnote
If an exception is thrown other than by the move constructor of a non-\tcode{CopyInsertable} \tcode{T} there are no effects.
\end{itemdescr}

\indexlibrary{\idxcode{swap}!\idxcode{vector}}%
Expand Down Expand Up @@ -4891,13 +4904,17 @@
\begin{itemdescr}
\pnum
\effects If \tcode{sz <= size()}, equivalent to
\tcode{erase(begin() + sz, end());}. If \tcode{size() < sz},
calling \tcode{pop_back()} \tcode{size() - sz} times. If \tcode{size() < sz},
appends \tcode{sz - size()} value-initialized elements to the
sequence.

\pnum
\requires \tcode{T} shall be
\tcode{CopyInsertable} into \tcode{*this}.
\tcode{MoveInsertable} into \tcode{*this} and \tcode{DefaultConstructible}.

\pnum
\notes If an exception is thrown other than by the move constructor of a non-\tcode{CopyInsertable}
\tcode{T} there are no effects.
\end{itemdescr}

\indexlibrary{\idxcode{resize}!\idxcode{vector}}%
Expand All @@ -4907,18 +4924,16 @@

\begin{itemdescr}
\pnum
\effects
\begin{codeblock}
if (sz > size())
insert(end(), sz-size(), c);
else if (sz < size())
erase(begin()+sz, end());
else
; // do nothing
\end{codeblock}
\effects If \tcode{sz <= size()}, equivalent to
calling \tcode{pop_back()} \tcode{size() - sz} times. If \tcode{size() < sz},
appends \tcode{sz - size()} copies of \tcode{c} to the sequence.

\pnum
\requires \tcode{T} shall be \tcode{MoveInsertable} into \tcode{*this} and
\tcode{CopyInsertable} into \tcode{*this}.

\pnum
\requires If an exception is thrown other than by the move constructor of a
\notes If an exception is thrown other than by the move constructor of a
non-\tcode{CopyInsertable} \tcode{T} there are no effects.
\end{itemdescr}

Expand Down

0 comments on commit 3b28afd

Please sign in to comment.