Compartir a través de


hash_multimap::cbegin

Note

This API is obsolete. The alternative is unordered_multimap Class.

Returns a const iterator addressing the first element in the hash_multimap.

const_iterator cbegin( ) const;

Return Value

A const bidirectional iterator addressing the first element in the hash_multimap Class or the location succeeding an empty hash_multimap.

Remark

With the return value of cbegin, the hash_multimap object cannot be modified.

In Visual C++ .NET 2003, members of the <hash_map> and <hash_set> header files are no longer in the std namespace, but rather have been moved into the stdext namespace. See The stdext Namespace for more information.

Example

// 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;
   }
The first element of hm1 is 2.

Requirements

Header: <hash_map>

Namespace: stdext

See Also

Reference

hash_multimap Class

Standard Template Library