hash_multimap::cend

说明说明

此 API 已过时。另一种方法是 unordered_multimap Class

返回解决成功最后一个元素的位置。hash_multimap 的常量迭代器。

const_iterator cend( ) const;

返回值

解决成功最后一个元素的位置。hash_multimap Class的常量双向迭代器。如果 hash_multimap 为空,然后 hash_multimap::cend == hash_multimap::begin。

备注

cend 用于测试迭代器是否已到达其 hash_multimap 的末尾。

不应取消引用 cend 返回的值。

在 Visual C++ .NET 2003 中,<hash_map><hash_set> 标头文件的成员中不再标准,命名空间,而是将 stdext 命名空间。有关更多信息,请参见 stdext 命名空间

示例

// hash_multimap_cend.cpp
// compile with: /EHsc
#include <hash_multimap>
#include <iostream>

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

   hash_multimap <int, int> :: const_iterator hm1_cIter;
   typedef pair <int, int> Int_Pair;

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

   hm1_cIter = hm1.cend( );
   hm1_cIter--;
   cout << "The value of last element of hm1 is " 
        << hm1_cIter -> second << "." << endl;
   }
  

要求

标头: <hash_map>

命名空间: stdext

请参见

参考

hash_multimap Class

标准模板库