次の方法で共有


multimap::crbegin

反転 multimap の一つ目の要素を指定する定数反復子を返します。

const_reverse_iterator crbegin( ) const;

戻り値

逆順の multimap クラス の一つ目の要素を指定する場合は、通常 multimapの最後の要素では、定数逆順の反転双方向の反復子。

解説

crbegin、反転した multimap と 開始 が multimapと併用するために使用されます。

crbegin の戻り値で multimap オブジェクトを変更することはできません。

crbegin が multimap を逆方向に反復処理するために使用できます。

使用例

// multimap_crbegin.cpp
// compile with: /EHsc
#include <map>
#include <iostream>

int main( )
{
   using namespace std;
   multimap <int, int> m1;

   multimap <int, int> :: const_reverse_iterator m1_crIter;
   typedef pair <int, int> Int_Pair;

   m1.insert ( Int_Pair ( 1, 10 ) );
   m1.insert ( Int_Pair ( 2, 20 ) );
   m1.insert ( Int_Pair ( 3, 30 ) );

   m1_crIter = m1.crbegin( );
   cout << "The first element of the reversed multimap m1 is "
        << m1_crIter -> first << "." << endl;
}
  

必要条件

ヘッダー: <map>

名前空間: std

参照

関連項目

multimap クラス

標準テンプレート ライブラリ