- set[meta header]
- std[meta namespace]
- multiset[meta class]
- function[meta id-type]
- cpp11[meta cpp]
const_reverse_iterator crbegin() const noexcept;
multiset
コンテナ内の末尾の要素を指す、読み取り専用逆イテレータを取得する。
反転したシーケンスの先頭を指す、読み取り専用逆イテレータ。
const_reverse_iterator
はメンバ型である。multiset
クラステンプレートにおいて、これは双方向イテレータであり、reverse_iterator<const_iterator>
と定義される。
定数時間。
#include <iostream>
#include <set>
#include <algorithm>
int main()
{
std::multiset<int> c = {1, 1, 2};
// このアルゴリズム内ではcの書き換えを決して行わない
std::for_each(c.crbegin(), c.crend(), [](const int& x) {
std::cout << x << std::endl;
});
}
- crbegin()[color ff0000]
- crend()[link crend.md]
2
1
1
名前 | 説明 |
---|---|
crend |
先頭の前を指す読み取り専用逆イテレータを取得する |
cbegin |
先頭を指す読み取り専用イテレータを取得する |
cend |
末尾の次を指す読み取り専用イテレータを取得する |