std::ranges::chunk_by_view<V,Pred>::base
From cppreference.com
< cpp | ranges | chunk by view
| constexpr V base() const& requires std::copy_constructible<V>; |
(1) | (C++23から) |
| constexpr V base() &&; |
(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())); }