![]() |
---|
此 API 已过时。另一种方法是 unordered_multimap Class。 |
返回解决常数的迭代器 hash_multimap 的第一个元素。
const_iterator cbegin( ) const;
返回值
解决 const 双向的迭代器在成功空 hash_multimap的 hash_multimap Class 的第一个元素或位置。
备注
cbegin的返回值,就不能修改 hash_multimap 对象。
在 Visual C++ .NET 2003 中,<hash_map> 和 <hash_set> 标头文件的成员中不再标准,命名空间,而是将 stdext 命名空间。有关更多信息,请参见 stdext 命名空间。
示例
// hash_multimap_cbegin.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 ( 2, 4 ) );
hm1_cIter = hm1.cbegin ( );
cout << "The first element of hm1 is "
<< hm1_cIter -> first << "." << endl;
}
要求
标头: <hash_map>
命名空间: stdext