collection_adapter::collection_adapter (STL/CLR)
Cria um objeto do adaptador.
collection_adapter();
collection_adapter(collection_adapter<Coll>% right);
collection_adapter(collection_adapter<Coll>^ right);
collection_adapter(Coll^ collection);
Parâmetros
coleção
Identificador da BCL envolver.direita
Objeto a ser copiado.
Comentários
O construtor:
collection_adapter();
inicializa o identificador armazenadas com nullptr.
O construtor:
collection_adapter(collection_adapter<Coll>% right);
inicializa o identificador armazenadas com right.collection_adapter::base (STL/CLR)().
O construtor:
collection_adapter(collection_adapter<Coll>^ right);
inicializa o identificador armazenadas com right->collection_adapter::base (STL/CLR)().
O construtor:
collection_adapter(Coll^ collection);
inicializa o identificador armazenada com a collection.
Exemplo
// 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);
}
Requisitos
cliext </adaptador deCabeçalho: >
cliext deNamespace: