hash_map::end (STL/CLR)

指定受控序列的末尾。

    iterator end();

备注

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

示例

// cliext_hash_map_end.cpp 
// compile with: /clr 
#include <cliext/hash_map> 
 
typedef cliext::hash_map<wchar_t, int> Myhash_map; 
int main() 
    { 
    Myhash_map c1; 
    c1.insert(Myhash_map::make_value(L'a', 1)); 
    c1.insert(Myhash_map::make_value(L'b', 2)); 
    c1.insert(Myhash_map::make_value(L'c', 3)); 
 
// display contents " [a 1] [b 2] [c 3]" 
    for each (Myhash_map::value_type elem in c1) 
        System::Console::Write(" [{0} {1}]", elem->first, elem->second); 
    System::Console::WriteLine(); 
 
// inspect last two items 
    Myhash_map::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/hash_map>

命名空间: cliext

请参见

参考

hash_map (STL/CLR)

hash_map::begin (STL/CLR)