Namespaces
Variants

std::ranges::slide_view<V>:: end

From cppreference.net
Ranges library
Range adaptors
constexpr auto end ( )
requires ( ! ( /*simple-view*/ < V > && /*slide-caches-nothing*/ < const V > ) ) ;
(1) (C++23以降)
constexpr auto end ( ) const
requires /*slide-caches-nothing*/ < const V > ;
(2) (C++23以降)

sentinel または iterator を返します。これは slide_view の終端を表します。

1) base_ n_ を基底データメンバとする。以下と等価:
V slide-caches-last をモデル化する場合、この関数は結果を cached_end_ 内にキャッシュし、後続の呼び出しで使用します。これは、 range で要求される償却定数時間計算量を提供するために必要です。
2) 次と同等: begin ( ) + ranges:: range_difference_t < const V > ( size ( ) ) .

目次

翻訳内容: - 「Contents」→「目次」 - その他のC++関連用語(Parameters、Return value、Example、See also)は翻訳せずに保持 - HTMLタグ、属性、クラス名、IDなどはすべて元のまま保持 - 番号やリンク構造も変更なし

パラメータ

(なし)

戻り値

sentinel または iterator を表し、 slide_view の終端を示す。

#include <iostream>
#include <ranges>
int main()
{
    static constexpr auto source = {'A', 'B', 'C', 'D'};
    for (const auto subrange: source | std::views::slide(3))
    {
        std::cout << "[ ";
        for (auto it = subrange.begin(); it != subrange.end(); ++it)
            std::cout << *it << ' ';
        std::cout << "]\n";
    }
}

出力:

[ A B C ]
[ B C D ]

関連項目

先頭を指すイテレータを返す
(公開メンバ関数)
範囲の先頭を指すイテレータを返す
(カスタマイゼーションポイントオブジェクト)
範囲の終端を示すセンチネルを返す
(カスタマイゼーションポイントオブジェクト)