collection_adapter::collection_adapter (STL/CLR)
建構配接器物件。
collection_adapter();
collection_adapter(collection_adapter<Coll>% right);
collection_adapter(collection_adapter<Coll>^ right);
collection_adapter(Coll^ collection);
參數
集合
BCL 控點,以自動換行。right
若要複製的物件。
備註
建構函式:
collection_adapter();
初始化儲存的控制代碼與nullptr。
建構函式:
collection_adapter(collection_adapter<Coll>% right);
初始化儲存的控制代碼與right.collection_adapter::base (STL/CLR)()。
建構函式:
collection_adapter(collection_adapter<Coll>^ right);
初始化儲存的控制代碼與right->collection_adapter::base (STL/CLR)()。
建構函式:
collection_adapter(Coll^ collection);
初始化儲存的控制代碼與collection。
範例
// 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);
}
需求
標頭: < cliext/介面卡 >
Namespace: cliext