list::end (STL/CLR)
被制御シーケンスの末尾を指定します。
iterator end();
解説
メンバー関数は、被制御シーケンスの末尾の次の位置を指すランダム アクセス反復子を返します。被制御シーケンスの末尾を指定する反復子を取得するために使用します; 被制御シーケンスの期間が変更された場合に、状態の doesn のない変更。
使用例
// cliext_list_end.cpp
// compile with: /clr
#include <cliext/list>
int main()
{
cliext::list<wchar_t> c1;
c1.push_back(L'a');
c1.push_back(L'b');
c1.push_back(L'c');
// display initial contents " a b c"
for each (wchar_t elem in c1)
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
// inspect last two items
cliext::list<wchar_t>::iterator it = c1.end();
--it;
System::Console::WriteLine("*-- --end() = {0}", *--it);
System::Console::WriteLine("*--end() = {0}", *++it);
// alter first two items and reinspect
*--it = L'x';
*++it = L'y';
for each (wchar_t elem in c1)
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
return (0);
}
必要条件
ヘッダー:<cliext/リスト>
名前空間: の cliext