multiset::cbegin
Returns a const iterator addressing the first element in the multiset.
const_iterator cbegin( ) const;
A const bidirectional iterator addressing the first element in the multiset or the location succeeding an empty multiset.
With the return value of cbegin, the elements in the multiset object cannot be modified.
// multiset_cbegin.cpp
// compile with: /EHsc
#include <set>
#include <iostream>
int main( )
{
using namespace std;
multiset <int> ms1;
multiset <int>::const_iterator ms1_cIter;
ms1.insert( 1 );
ms1.insert( 2 );
ms1.insert( 3 );
ms1_cIter = ms1.cbegin( );
cout << "The first element of ms1 is " << *ms1_cIter << endl;
}
The first element of ms1 is 1
Header: <set>
Namespace: std