다음을 통해 공유


hash_multiset::crend

Returns a const iterator that addresses the location succeeding the last element in a reversed hash_multiset.

const_reverse_iterator crend( ) const;

Return Value

A const reverse bidirectional iterator that addresses the location succeeding the last element in a reversed hash_multiset Class (the location that had preceded the first element in the unreversed hash_multiset).

Remarks

crend is used with a reversed hash_multiset just as hash_multiset::end is used with a hash_multiset.

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

crend can be used to test to whether a reverse iterator has reached the end of its hash_multiset.

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_crend.cpp
// compile with: /EHsc
#define _DEFINE_DEPRECATED_HASH_CLASSES 0
#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.crend( );
   hs1_crIter--;
   cout << "The last element in the reversed hash_multiset is "
        << *hs1_crIter << "." << endl;
}
The last element in the reversed hash_multiset is 10.

Requirements

Header: <hash_multiset>

Namespace: stdext

See Also

Reference

hash_multiset Class

Standard Template Library

Other Resources

hash_multiset Members