A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://timsong-cpp.github.io/cppwp/n4659/deque.capacity below:

[deque.capacity]

26 Containers library [containers] 26.3 Sequence containers [sequences] 26.3.8 Class template deque [deque] 26.3.8.3 deque capacity [deque.capacity]

void resize(size_type sz);

Effects: If sz < size(), erases the last size() - sz elements from the sequence. Otherwise, appends sz - size() default-inserted elements to the sequence.

Requires: T shall be MoveInsertable and DefaultInsertable into *this.

void resize(size_type sz, const T& c);

Effects: If sz < size(), erases the last size() - sz elements from the sequence. Otherwise, appends sz - size() copies of c to the sequence.

Requires: T shall be CopyInsertable into *this.

void shrink_to_fit();

Requires: T shall be MoveInsertable into *this.

Effects: shrink_­to_­fit is a non-binding request to reduce memory use but does not change the size of the sequence. [Note: The request is non-binding to allow latitude for implementation-specific optimizations. end note] If an exception is thrown other than by the move constructor of a non-CopyInsertable T there are no effects.

Complexity: Linear in the size of the sequence.

Remarks: shrink_­to_­fit invalidates all the references, pointers, and iterators referring to the elements in the sequence as well as the past-the-end iterator.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4