collection_adapter::collection_adapter (STL/CLR)
Erstellt ein Adapterobjekt.
collection_adapter();
collection_adapter(collection_adapter<Coll>% right);
collection_adapter(collection_adapter<Coll>^ right);
collection_adapter(Coll^ collection);
Parameter
Auflistung
BCL-Handle einzubindende.right
Objekt für die Kopie.
Hinweise
Der Konstruktor:
collection_adapter();
initialisiert das gespeicherte Handle mit nullptr.
Der Konstruktor:
collection_adapter(collection_adapter<Coll>% right);
initialisiert das gespeicherte Handle mit right.collection_adapter::base (STL/CLR)().
Der Konstruktor:
collection_adapter(collection_adapter<Coll>^ right);
initialisiert das gespeicherte Handle mit right->collection_adapter::base (STL/CLR)().
Der Konstruktor:
collection_adapter(Coll^ collection);
initialisiert das gespeicherte Handle mit collection.
Beispiel
// cliext_collection_adapter_construct.cpp
// compile with: /clr
#include <cliext/adapter>
#include <cliext/deque>
typedef cliext::collection_adapter<
System::Collections::ICollection> Mycoll;
int main()
{
cliext::deque<wchar_t> d6x(6, L'x');
// construct an empty container
Mycoll c1;
System::Console::WriteLine("base() null = {0}", c1.base() == nullptr);
// construct with a handle
Mycoll c2(%d6x);
for each (wchar_t elem in c2)
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
// construct by copying another container
Mycoll c3(c2);
for each (wchar_t elem in c3)
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
// construct by copying a container handle
Mycoll c4(%c3);
for each (wchar_t elem in c4)
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
return (0);
}
Anforderungen
Header: <cliext/Adapter>
Namespace: cliext