1164
备注:
|
1163
|
删除的内容标记成这样。 | 加入的内容标记成这样。 |
行号 24: | 行号 24: |
||T || The vector's value type: the type of object that is stored in the vector. || || | ||T || The vector's value type: the type of object that is stored in the vector. |||| |
vector<T, Alloc>
Category: containers
Component type: type
Description
A vector is a Sequence that supports random access to elements, constant time insertion and removal of elements at the end, and linear time insertion and removal of elements at the beginning or in the middle. The number of elements in a vector may vary dynamically; memory management is automatic. Vector is the simplest of the STL container classes, and in many cases the most efficient.
Example
Definition
Defined in the standard header vector, and in the nonstandard backward-compatibility header vector.h. Template parameters
Parameter |
Description |
Default |
||T || The vector's value type: the type of object that is stored in the vector. ||||
Alloc |
The vector's allocator, used for all internal memory management. |
alloc |
Model of
Random Access Container, Back Insertion Sequence.
Type requirements
None, except for those imposed by the requirements of Random Access Container and Back Insertion Sequence.