std::ranges::chunk_by_view<V,Pred>::base
来自cppreference.com
| |
(1) | (C++23 起) |
| |
(2) | (C++23 起) |
返回底层视图 base_ 的副本。
1) 从底层视图拷贝构造结果。等价于:
return base_;参数
(无)
返回值
底层视图的副本。
示例
运行此代码
#include <algorithm>
#include <functional>
#include <ranges>
int main()
{
static constexpr auto v = {1, 1, 2, 2, 3, 3, 3};
constexpr auto chunks = v | std::views::chunk_by(std::equal_to{});
static_assert(std::ranges::equal(v, chunks.base()));
}