std::experimental::ranges:: mismatch
|
template
<
InputIterator I1, Sentinel
<
I1
>
S1, InputIterator I2, Sentinel
<
I2
>
S2,
class
Proj1
=
ranges::
identity
,
class
Proj2
=
ranges::
identity
,
|
(1) | (ranges TS) |
|
template
<
InputRange R1, InputRange R2,
class
Proj1
=
ranges::
identity
,
class
Proj2
=
ranges::
identity
,
|
(2) | (ranges TS) |
|
template
<
InputIterator I1, Sentinel
<
I1
>
S1,
class
I2,
class
Pred
=
ranges::
equal_to
<>
,
|
(3) |
(ranges TS)
(非推奨) |
|
template
<
InputRange R1,
class
I2,
class
Pred
=
ranges::
equal_to
<>
,
class
Proj1
=
ranges::
identity
,
class
Proj2
=
ranges::
identity
>
|
(4) |
(ranges TS)
(非推奨) |
[
first1
,
last1
)
で定義され、もう1つは
[
first2
,
last2
)
で定義されます。
要素は、2つの範囲の射影された要素に対して pred を使用して比較されます。比較は以下のように行われます: ranges:: invoke ( pred, ranges:: invoke ( proj1, * i ) , ranges:: invoke ( proj2, * j ) ) 。
上記に示された宣言にかかわらず、アルゴリズム宣言の実際のテンプレートパラメータの数と順序は未規定です。したがって、アルゴリズムを呼び出す際に明示的なテンプレート引数を使用する場合、プログラムはおそらく移植性がありません。
目次 |
、
、
パラメータ
| first1, last1 | - | 要素の最初の範囲 |
| r1 | - | 要素の最初の範囲 |
| first2, last2 | - | 要素の2番目の範囲 |
| r2 | - | 要素の2番目の範囲 |
| first2_ | - | 要素の2番目の範囲の開始位置 |
| pred | - | 投影された要素に適用する述語 |
| proj1 | - | 最初の範囲の要素に適用する投影 |
| proj2 | - | 2番目の範囲の要素に適用する投影 |
戻り値
最初の2つの等しくない要素へのイテレータを持つ
tagged_pair
オブジェクト(最初の範囲からのイテレータはタグ
in1
を持ち、2番目の範囲からのイテレータはタグ
in2
を持つ)。
比較が last1 または last2 に到達した時点で不一致が見つからない場合、そのペアは終端イテレータと他方の範囲からの対応するイテレータを保持します。
計算量
最大で last1 - first1 回の述語と各射影の適用。
実装例
template<InputIterator I1, Sentinel<I1> S1, InputIterator I2, Sentinel<I2> S2, class Proj1 = ranges::identity, class Proj2 = ranges::identity, class Pred = ranges::equal_to<>> requires IndirectRelation<Pred, projected<I1, Proj1>, projected<I2, Proj2>> auto mismatch(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) -> ranges::tagged_pair<tag::in1(I1), tag::in2(I2)> { while (first1 != last1 && first2 != last2 && ranges::invoke(pred, ranges::invoke(proj1, *first1), ranges::invoke(proj2, *first2))) { ++first1; ++first2; } return {first1, first2}; } |
例
|
このセクションは不完全です
理由: 例がありません |
関連項目
|
2つの範囲が最初に異なる位置を見つける
(関数テンプレート) |
|
|
2つの要素集合が同じかどうかを判定する
(関数テンプレート) |
|
|
特定の基準を満たす最初の要素を見つける
(関数テンプレート) |
|
|
一方の範囲が辞書順でもう一方より小さい場合
true
を返す
(関数テンプレート) |
|
|
要素の範囲を検索する
(関数テンプレート) |