版本3和4间的区别
于2006-03-15 15:30:16修订的的版本3
大小: 1164
编辑: czk
备注:
于2006-03-15 15:30:38修订的的版本4
大小: 1163
编辑: czk
备注:
删除的内容标记成这样。 加入的内容标记成这样。
行号 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

   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.