map::end (STL/CLR)

指定受控序列的末尾。

    iterator end();

备注

成员函数返回该控件序列之外的末尾点的一双向迭代器。使用它获取指定控件序列末尾的迭代器;不是其状态 doesn 更改,如果控件序列的长度更改。

示例

// cliext_map_end.cpp 
// compile with: /clr 
#include <cliext/map> 
 
typedef cliext::map<wchar_t, int> Mymap; 
int main() 
    { 
    Mymap c1; 
    c1.insert(Mymap::make_value(L'a', 1)); 
    c1.insert(Mymap::make_value(L'b', 2)); 
    c1.insert(Mymap::make_value(L'c', 3)); 
 
// display contents " [a 1] [b 2] [c 3]" 
    for each (Mymap::value_type elem in c1) 
        System::Console::Write(" [{0} {1}]", elem->first, elem->second); 
    System::Console::WriteLine(); 
 
// inspect last two items 
    Mymap::iterator it = c1.end(); 
    --it; 
    --it; 
    System::Console::WriteLine("*-- --end() = [{0} {1}]", 
        it->first, it->second); 
    ++it; 
    System::Console::WriteLine("*--end() = [{0} {1}]", 
        it->first, it->second); 
    return (0); 
    } 
 

要求

标题: <cliext/映射>

命名空间: cliext

请参见

参考

map (STL/CLR)

map::begin (STL/CLR)