Uwaga
Dostęp do tej strony wymaga autoryzacji. Może spróbować zalogować się lub zmienić katalogi.
Dostęp do tej strony wymaga autoryzacji. Możesz spróbować zmienić katalogi.
Typ, który zawiera odwołanie do const element przechowywany w zestaw wielokrotny do odczytu i wykonywania const operacji.
typedef typename allocator_type::const_reference const_reference;
Przykład
// multiset_const_ref.cpp
// compile with: /EHsc
#include <set>
#include <iostream>
int main( )
{
using namespace std;
multiset <int> ms1;
ms1.insert( 10 );
ms1.insert( 20 );
// Declare and initialize a const_reference &Ref1
// to the 1st element
const int &Ref1 = *ms1.begin( );
cout << "The first element in the multiset is "
<< Ref1 << "." << endl;
// The following line would cause an error because the
// const_reference cannot be used to modify the multiset
// Ref1 = Ref1 + 5;
}
Wymagania
Nagłówek: <set>
Przestrzeń nazw: std