- span[meta header]
- std[meta namespace]
- span[meta class]
- function[meta id-type]
- cpp23[meta cpp]
constexpr const_reverse_iterator crbegin() const noexcept;
末尾を指す読み取り専用逆イテレータを取得する。
return rbegin();
- rbegin[link ./rbegin.md]
投げない
#include <iostream>
#include <span>
#include <vector>
int main() {
std::vector<int> v = {1, 2, 3, 4, 5};
std::span<int, 5> sp{v};
auto cit = sp.crbegin();
std::cout << *cit << '\n';
// これはできない
// *cit = 0;
}
- crbegin()[color ff0000]
5
- C++23
- Clang: ??
- GCC: 13.1
- Visual C++: 2022 Update 6