Namespaces
Variants

operator== (std::ranges::take_view:: sentinel <Const>)

From cppreference.net
Ranges library
Range adaptors
friend constexpr bool

operator == ( const std:: counted_iterator < ranges:: iterator_t < Base >> & y,

const /*sentinel*/ & x ) ;
(1) (C++20以降)
template < bool OtherC = ! Const >

requires std:: sentinel_for < ranges:: sentinel_t < Base > ,
ranges:: iterator_t < /*add-const-if*/ < OtherC, V >>>
friend constexpr bool
operator == ( const std:: counted_iterator <
ranges:: iterator_t < /*add-const-if*/ < OtherC, V >>> & y,

const /*sentinel*/ & x ) ;
(2) (C++20以降)

take_view :: /*sentinel*/ std::counted_iterator を比較します (通常は take_view::begin の呼び出しから取得されます)。

take_view コンストラクタ に渡されたN番目の要素を超えた位置を y が指している場合、または基になるビューの終端に達した場合に true を返します。

説明専用のエイリアステンプレート /*add-const-if*/ は以下のように定義される。
template < bool C, class T >
using /*add-const-if*/ = std:: conditional_t < C, const T, T > ;

これらの関数は通常の unqualified lookup qualified lookup では可視化されず、 argument-dependent lookup によってのみ発見され、その際 std::ranges::take_view:: sentinel <Const> が引数の関連クラスである場合に限られます。

!= 演算子は synthesized され、 operator== から生成されます。

目次

パラメータ

y - std::counted_iterator を比較する
x - 比較するセンチネル

戻り値

y. count ( ) == 0 || y. base ( ) == x. end_ 、ここで end_ は基盤となる番兵を表します。

不具合報告

以下の動作変更の欠陥報告書は、以前に公開されたC++規格に対して遡及的に適用されました。

DR Applied to Behavior as published Correct behavior
LWG 3449 C++20 異なるconst修飾を持つ
take_view のイテレータとセンチネルの比較がサポートされていなかった
可能な場合にサポートされるようにした