<vector>

定义容器模板类向量和多个支持的模板。

vector是一个容器,用于组织线性序列中给定类型的元素。 它使规则中的任何元素,和动态添加和移除并快速的随机访问。 vector是一系列的首选的容器时随机存取性能非常珍贵。

有关类vector,请参阅vector Class。 有关专用化vector<bool>,请参阅vector<bool> Class

namespace std {
template<class Type, class Allocator>
    class vector;
template<class Allocator>
    class vector<bool>;

template<class Allocator>
    struct hash<vector<bool, Allocator> >;

        // TEMPLATE FUNCTIONS
template<class Type, class Allocator>
    bool operator== (
        const vector< Type, Allocator>& _Left,
        const vector< Type, Allocator>& _Right
    );
template<class Type, class Allocator>
    bool operator!= (
        const vector< Type, Allocator>& _Left,
        const vector< Type, Allocator>& _Right
    );
template<class Type, class Allocator>
    bool operator< (
        const vector< Type, Allocator>& _Left,
        const vector< Type, Allocator>& _Right
    );
template<class Type, class Allocator>
    bool operator> (
        const vector< Type, Allocator>& _Left,
        const vector< Type, Allocator>& _Right
    );
template<class Type, class Allocator>
    bool operator<= (
        const vector< Type, Allocator>& _Left,
        const vector< Type, Allocator>& _Right
    );
template<class Type, class Allocator>
    bool operator>= (
        const vector< Type, Allocator>& _Left,
        const vector< Type, Allocator>& _Right
    );
template<class Type, class Allocator>
    void swap (
        vector< Type, Allocator>& _Left,
        vector< Type, Allocator>& _Right
    );
}  // namespace std

参数

  • 类型
    向量中存储的数据类型的模板参数。

  • 分配器
    负责内存分配和取消分配的存储分配器对象的模板参数。

  • _Left
    在比较操作中的第一个 (左) 向量

  • _Right
    第二个 (右图) 的向量中比较操作。

sxcsf7y7.collapse_all(zh-cn,VS.110).gif运算符

运算符!=

测试该运算符左侧的矢量对象不等于矢量对象的右侧。

运算符 <

测试该运算符左侧的矢量对象小于右侧矢量对象。

运算符 < =

测试矢量对象运算符的左侧小于或等于矢量对象的右侧。

运算符 = =

测试该运算符左侧的矢量对象等于右侧的矢量对象。

运算符 >

测试该运算符左侧的矢量对象大于右侧矢量对象。

运算符 > =

测试该运算符左侧的矢量对象大于或等于右边的矢量对象。

sxcsf7y7.collapse_all(zh-cn,VS.110).gif

向量类

序列容器中的线性排列排列给定类型的元素,并允许快速的随机访问的任何元素的模板类。

sxcsf7y7.collapse_all(zh-cn,VS.110).gif专用化

矢量 <bool> 类

完整向量的元素的类型的模板类专用化bool分配器所使用的专用化的基础类型的使用。

要求

标题: <vector>

命名空间: 标准

请参见

参考

线程安全性对标准C++库中

标准模板库

其他资源

vector 成员

标头文件