Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
This API is obsolete. The alternative is unordered_map Class.
Returns a const iterator that addresses the location succeeding the last element in a hash_map.
const_iterator cend( ) const;
Return Value
A const bidirectional iterator that addresses the location succeeding the last element in a hash_map Class. If the hash_map is empty, then hash_map::cend == hash_map::begin.
Remarks
cend is used to test whether an iterator has reached the end of its hash_map.
The value returned by cend should not be dereferenced.
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_map_cend.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_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;
}
The value of last element of hm1 is 30.
Requirements
Header: <hash_map>
Namespace: stdext