hash_map::crbegin

备注

此 API 已过时。替代为 unordered_map 类

返回满足处于已撤消的 hash_map 的 const 迭代器的第一个元素。

const_reverse_iterator crbegin( ) const;

返回值

解决已撤消的 hash_map 类 的第一个元素或解决操作的常量撤消双向迭代器位于 unreversed hash_map的最后一个元素。

备注

正值 开始 使用 hash_map,则使用crbegin 的反转 hash_map。

返回值 crbegin,不能修改 hash_map 对象。

crbegin 可用来通过 hash_map 向后循环访问。

在Visual C++ .NET 2003中,成员<hash_map><hash_set> 头文件不再在std命名空间,而是已经进入了stdext命名空间。 有关更多信息,请参见 stdext 命名空间

示例

// hash_map_crbegin.cpp
// compile with: /EHsc
#include <hash_map>
#include <iostream>

int main( )
{
   using namespace std;
   using namespace stdext;
   hash_map <int, int> hm1;

   hash_map <int, int> :: const_reverse_iterator hm1_crIter;
   typedef pair <int, int> Int_Pair;

   hm1.insert ( Int_Pair ( 3, 30 ) );

   hm1_crIter = hm1.crbegin( );
   cout << "The first element of the reversed hash_map hm1 is "
        << hm1_crIter -> first << "." << endl;
}
  

要求

标头: <hash_map>

**命名空间:**stdext

请参见

参考

hash_map 类

标准模板库