operator==(std::ranges::take_view::sentinel<Const>)
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 の呼び出しから取得される) と比較します。
イテレータが Ntrue 番目y の要素 (N は のコンストラクタに渡された数) を超えた位置を指している場合、または基盤となるビューの終端に達した場合に を返します。
説明専用のエイリアステンプレート take_view は次のように定義されます
。
/*add-const-if*/これらの関数は通常の
template<bool C, class T>using /*add-const-if*/ = std::conditional_t<C, const T, T>; 非修飾名検索
や 修飾名検索 では可視ではなく、引数がこのクラスの関連クラスである場合にのみ 引数依存の名前検索 によって発見されます。
演算子は から std::ranges::take_view::sentinel<Const> 合成
されます。
!= 演算子は から 合成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
のイテレータとセンチネルの比較がサポートされていなかった
|
可能な場合にサポートされるようにした |