std::ranges::chunk_view<V>::base
From cppreference.com
< cpp | ranges | chunk view
| constexpr V base() const& requires std::copy_constructible<V>; |
(1) | (C++23から) |
| constexpr V base() &&; |
(2) | (C++23から) |
基底ビューのコピーを返します。
1) 基になるビューから結果をコピー構築します。
base_ を返すのと同等です。2) 基になるビューから結果をムーブ構築します。
std::move(base_) を返すのと同等です。[編集] 返り値
基底ビューのコピー。
[編集] 例
例をオンラインでテストするためのリンク: Compiler Explorer。
このコードを実行
#include <print> #include <ranges> int main() { static constexpr auto v = {1, 2, 3, 4}; constexpr auto w{std::ranges::chunk_view(v, 2)}; std::println("{}", w.base()); }
出力
[1, 2, 3, 4]