다음을 통해 공유


hash_multiset::cend

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

const_iterator cend( ) const;

Return Value

A const bidirectional iterator that addresses the location succeeding the last element in a hash_multiset Class. If the hash_multiset is empty, then hash_multiset::cend == hash_multiset::begin.

Remarks

cend is used to test whether an iterator has reached the end of its hash_multiset. 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_multiset_cend.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_iterator hs1_cIter;
   
   hs1.insert( 1 );
   hs1.insert( 2 );
   hs1.insert( 3 );

   hs1_cIter = hs1.cend( );
   hs1_cIter--;
   cout << "The last element of hs1 is " << *hs1_cIter << endl;
}
The last element of hs1 is 3

Requirements

Header: <hash_set>

Namespace: stdext

See Also

Reference

hash_multiset Class

Standard Template Library

Other Resources

hash_multiset Members