Share via


hash_multiset::crbegin

Note

This API is obsolete. The alternative is unordered_multiset Class.

Returns a const iterator addressing the first element in a reversed hash_multiset.

const_reverse_iterator crbegin( ) const;

Return Value

A const reverse bidirectional iterator addressing the first element in a reversed hash_multiset Class or addressing what had been the last element in the unreversed hash_multiset.

Remarks

crbegin is used with a reversed hash_multiset just as hash_multiset::begin is used with a hash_multiset.

With the return value of crbegin, the hash_multiset object cannot be modified.

crbegin can be used to iterate through a hash_multiset backwards.

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_multiset_crbegin.cpp
// compile with: /EHsc
#include <hash_multiset>
#include <iostream>

int main( )
{
   using namespace std;
   using namespace stdext;
   hash_multiset <int> hs1;
   hash_multiset <int>::const_reverse_iterator hs1_crIter;

   hs1.insert( 10 );
   hs1.insert( 20 );
   hs1.insert( 30 );

   hs1_crIter = hs1.crbegin( );
   cout << "The first element in the reversed hash_multiset is "
        << *hs1_crIter << "." << endl;
}
The first element in the reversed hash_multiset is 30.

Requirements

Header: <hash_set>

Namespace: stdext

See Also

Reference

hash_multiset Class

Standard Template Library