range_adapter::range_adapter (STL/CLR)
建構配接器物件。
range_adapter();
range_adapter(range_adapter<Iter>% right);
range_adapter(range_adapter<Iter>^ right);
range_adapter(Iter first, Iter last);
參數
first
要包裝的第一個迭代器。last
第二個要包裝的迭代器。right
要複製的物件。
備註
建構函式:
range_adapter();
使用預設已建構的迭代器初始化已儲存的迭代器。
建構函式:
range_adapter(range_adapter<Iter>% right);
透過複製儲存在 right中的迭代器對初始化已儲存的迭代器。
建構函式:
range_adapter(range_adapter<Iter>^ right);
透過複製儲存在 *right中的迭代器對初始化已儲存的迭代器。
建構函式:
range_adapter(Iter^ first, last);
使用 first 和 last 初始化儲存的迭代器。
範例
// cliext_range_adapter_construct.cpp
// compile with: /clr
#include <cliext/adapter>
#include <cliext/deque>
typedef cliext::deque<wchar_t> Mycont;
typedef cliext::range_adapter<Mycont::iterator> Myrange;
int main()
{
cliext::deque<wchar_t> d1;
d1.push_back(L'a');
d1.push_back(L'b');
d1.push_back(L'c');
// construct an empty adapter
Myrange c1;
// construct with an iterator pair
Myrange c2(d1.begin(), d1.end());
for each (wchar_t elem in c2)
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
// construct by copying another adapter
Myrange c3(c2);
for each (wchar_t elem in c3)
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
// construct by copying an adapter handle
Myrange c4(%c3);
for each (wchar_t elem in c4)
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
return (0);
}
需求
標頭: <cliext/adapter>
命名空間: cliext