Share via


multiset::cbegin

Returns a const iterator addressing the first element in the multiset.

const_iterator cbegin( ) const;

Return Value

A const bidirectional iterator addressing the first element in the multiset or the location succeeding an empty multiset.

Remark

With the return value of cbegin, the elements in the multiset object cannot be modified.

Example

// 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

Requirements

Header: <set>

Namespace: std

See Also

Reference

multiset Class

Standard Template Library