You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wraps a .NET collection for use as an STL/CLR container. A collection_adapter is a template class that describes a simple STL/CLR container object. It wraps a Base Class Library (BCL) interface, and returns an iterator pair that you use to manipulate the controlled sequence.
Syntax
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>>;
You use this template class to manipulate a BCL container as a STL/CLR container. The collection_adapter stores a handle to a BCL interface, which in turn controls a sequence of elements. A collection_adapter object X returns a pair of input iterators X.begin() and X.end() that you use to visit the elements, in order. Some of the specializations also let you write X.size() to determine the length of the controlled sequence.