<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-tw,VS.110).gif運算子

運算子!=

測試運算子左邊的向量物件不等於右邊的向量物件。

運算子 <

如果運算子左邊的向量物件是小於向量物件的右邊顯示的測試。

運算子 < =

如果運算子左邊的向量物件的測試小於或等於向量物件的右邊顯示。

運算子 = =

測試運算子左邊的向量物件等於右邊的向量物件。

運算子 >

測試運算子左邊的向量物件大於在右邊的向量物件。

運算子 > =

測試運算子左邊的向量物件大於或等於在右邊的向量物件。

sxcsf7y7.collapse_all(zh-tw,VS.110).gif類別

向量類別

樣板類別的順序容器,排列項目給定型別的以線性的排列方式,並允許快速隨機存取的任何項目。

sxcsf7y7.collapse_all(zh-tw,VS.110).gif特製化

向量 <bool> 類別

完整的特製化的項目類型的範本類別向量的bool與配置器的特製化所用的基礎型別。

需求

標頭: <vector>

Namespace: 標準

請參閱

參考

在標準 C++ 程式庫中的執行緒安全

標準樣板程式庫

其他資源

<vector> 成員

標頭檔