hash_set::cbegin
Note
This API is obsolete. The alternative is unordered_set Class.
Returns a const iterator that addresses the first element in the hash_set.
const_iterator cbegin( ) const;
Return Value
A const bidirectional iterator addressing the first element in the hash_set Class or the location succeeding an empty hash_set.
Remarks
With the return value of cbegin, the elements in the hash_set 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_set_cbegin.cpp
// compile with: /EHsc
#include <hash_set>
#include <iostream>
int main( )
{
using namespace std;
using namespace stdext;
hash_set <int> hs1;
hash_set <int>::const_iterator hs1_cIter;
hs1.insert( 1 );
hs1.insert( 2 );
hs1.insert( 3 );
hs1_cIter = hs1.cbegin( );
cout << "The first element of hs1 is " << *hs1_cIter << endl;
}
The first element of hs1 is 1
Requirements
Header: <hash_set>
Namespace: stdext