版本1和2间的区别
于2006-03-15 15:28:33修订的的版本1
大小: 1145
编辑: czk
备注:
于2006-03-15 15:29:52修订的的版本2
大小: 1158
编辑: czk
备注:
删除的内容标记成这样。 加入的内容标记成这样。
行号 23: 行号 23:
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
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 ||

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

   1 vector<int> V;
   2 V.insert(V.begin(), 3);
   3 assert(V.size() == 1 && V.capacity() >= 1 && V[0] == 3);

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.

STL编程指南/vector (2008-02-23 15:36:53由localhost编辑)

ch3n2k.com | Copyright (c) 2004-2020 czk.