std::flat_set<Key,Compare,KeyContainer>::rend, std::flat_set<Key,Compare,KeyContainer>::crend
来自cppreference.com
<tbody>
</tbody>
reverse_iterator rend() noexcept; |
(1) | (C++23 起) |
const_reverse_iterator rend() const noexcept; |
(2) | (C++23 起) |
const_reverse_iterator crend() const noexcept; |
(3) | (C++23 起) |
返回指向逆向的 flat_set 末元素后一元素的逆向迭代器。它对应非逆向 flat_set 首元素的前一元素。此元素表现为占位符,试图访问它导致未定义行为。
返回值
指向末元素后一元素的逆向迭代器。
复杂度
常数。
示例
运行此代码
#include <iostream>
#include <flat_set>
int main()
{
std::flat_set<unsigned> rep{1, 2, 3, 4, 1, 2, 3, 4};
for (auto it = rep.crbegin(); it != rep.crend(); ++it)
{
for (auto n = *it; n > 0; --n)
std::cout << "⏼" << ' ';
std::cout << '\n';
}
}
输出:
⏼ ⏼ ⏼ ⏼
⏼ ⏼ ⏼
⏼ ⏼
⏼
参阅
| 返回指向起始的逆向迭代器 (公开成员函数) | |
(C++14) |
返回容器或数组的逆向尾迭代器 (函数模板) |