collection_adapter (STL/CLR)

自動換行。NET 作為 STL/CLR 容器的集合。A collection_adapter是樣板類別,將告訴您一個簡單的 STL/CLR 容器物件。它的基底類別程式庫 (BCL) 介面,會換行,並傳回用來管理受控制的序列的 iterator 組。

template<typename Coll>
    ref class collection_adapter;

template<>
    ref class collection_adapter<
        System::Collections::ICollection>;
template<>
    ref class collection_adapter<
        System::Collections::IEnumerable>;
template<>
    ref class collection_adapter<
        System::Collections::IList>;
template<>
    ref class collection_adapter<
        System::Collections::IDictionary>;
template<typename Value>
    ref class collection_adapter<
        System::Collections::Generic::ICollection<Value>>;
template<typename Value>
    ref class collection_adapter<
        System::Collections::Generic::IEnumerable<Value>>;
template<typename Value>
    ref class collection_adapter<
        System::Collections::Generic::IList<Value>>;
template<typename Key,
    typename Value>
    ref class collection_adapter<
        System::Collections::Generic::IDictionary<Key, Value>>;

參數

  • Coll
    包裝的集合型別。

特製化

特製化

描述

IEnumerable

透過項目序列。

ICollection

維護一組元件。

IList

保留項目有序的的群組。

IDictionary

維護一組 {key,value} 的配對。

IEnumerable <Value>

具型別項目序列。

ICollection <Value>

維護一組具型別的元件。

IList <Value>

維護型別元素的有序的群組。

IDictionary <Value>

都會維持一連串具型別 {key,value} 配對。

Members

型別定義

描述

collection_adapter::difference_type (STL/CLR)

帶正負號的距離,兩個元素之間的型別。

collection_adapter::iterator (STL/CLR)

受控制序列的 iterator 型別。

collection_adapter::key_type (STL/CLR)

字典索引鍵的型別。

collection_adapter::mapped_type (STL/CLR)

字典值的型別。

collection_adapter::reference (STL/CLR)

項目之參考型別。

collection_adapter::size_type (STL/CLR)

帶正負號的距離,兩個元素之間的型別。

collection_adapter::value_type (STL/CLR)

項目的型別。

成員函式

描述

collection_adapter::base (STL/CLR)

將指定的換行的 BCL 介面。

collection_adapter::begin (STL/CLR)

指定受控制序列的開頭。

collection_adapter::collection_adapter (STL/CLR)

建構配接器物件。

collection_adapter::end (STL/CLR)

指定受控制序列的結尾。

collection_adapter::size (STL/CLR)

計數項目的數目。

collection_adapter::swap (STL/CLR)

交換兩個容器的內容。

運算子

描述

collection_adapter::operator= (STL/CLR)

將會取代儲存的 BCL 的控制代碼。

備註

您可以使用這個樣板類別來操作 BCL 容器為 STL/CLR 容器。collection_adapter會儲存在控點 BCL 的介面,用來依序控制序列的項目。A collection_adapter物件X會傳回一組輸入 iterator 的X.begin()和X.end()大膽建議您使用瀏覽的項目,順序。部分特製化還可讓您撰寫X.size()來判斷受控制序列的長度。

需求

標頭: < cliext/介面卡 >

Namespace: cliext

請參閱

參考

range_adapter (STL/CLR)

make_collection (STL/CLR)