名前空間
変種
操作

operator-(ranges::adjacent_view::sentinel)

From cppreference.com
< cpp‎ | ranges‎ | adjacent view‎ | sentinel
 
 
Rangesライブラリ
Rangeアダプタ
 
 
template< bool OtherConst >

    requires std::sized_sentinel_for<ranges::sentinel_t<Base>,
                                     ranges::iterator_t</*maybe-const*/<OtherConst, V>>>
friend constexpr ranges::range_difference_t</*maybe-const*/<OtherConst, V>>

    operator-( const /*iterator*/<OtherConst>& x, const /*sentinel*/& y );
(1) (C++23から)
template< bool OtherConst >

    requires std::sized_sentinel_for<ranges::sentinel_t<Base>,
                                     ranges::iterator_t</*maybe-const*/<OtherConst, V>>>
friend constexpr ranges::range_difference_t</*maybe-const*/<OtherConst, V>>

    operator-( const /*sentinel*/& y, const /*iterator*/<OtherConst>& x );
(2) (C++23から)

x の基底イテレータと y の基底センチネルとの間の距離を計算します。

current_ はxの基底となるイテレータ配列を表し、end_ はyの基底となるセンチネルを表します。

1) 次に相当します: return x.current_.back() - y.end_;
2) 次に相当します: return y.end_ - x.current_.back();

これらの関数テンプレートは、通常の非修飾または修飾ルックアップからは見えず、adjacent_view::sentinel が引数に関連付けられたクラスである場合にのみ、引数依存名前探索によって見つけることができます。

目次

[編集] パラメータ

x - イテレータ
y - センチネル

[編集] 戻り値

xy の間の距離。

[編集]

[編集] 関連項目

English 日本語 中文(简体) 中文(繁體)