共用方式為


list::end (STL/CLR)

指定受控制序列的結尾。

    iterator end();

備註

在受控制序列之結尾點的成員函式會傳回隨機存取 Iterator。 您會受控制序列之結尾的它來取得 Iterator;不是它的狀態 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

請參閱

參考

list (STL/CLR)

list::back (STL/CLR)

list::back_item (STL/CLR)

list::begin (STL/CLR)