std::experimental::ranges:: mismatch
|
헤더에 정의됨
<experimental/ranges/algorithm>
|
||
|
template
<
InputIterator I1, Sentinel
<
I1
>
S1, InputIterator I2, Sentinel
<
I2
>
S2,
class
Proj1
=
ranges::
identity
,
class
Proj2
=
ranges::
identity
,
|
(1) | (범위 TS) |
|
template
<
InputRange R1, InputRange R2,
class
Proj1
=
ranges::
identity
,
class
Proj2
=
ranges::
identity
,
|
(2) | (범위 TS) |
|
template
<
InputIterator I1, Sentinel
<
I1
>
S1,
class
I2,
class
Pred
=
ranges::
equal_to
<>
,
|
(3) |
(범위 TS)
(사용 중단됨) |
|
template
<
InputRange R1,
class
I2,
class
Pred
=
ranges::
equal_to
<>
,
class
Proj1
=
ranges::
identity
,
class
Proj2
=
ranges::
identity
>
|
(4) |
(범위 TS)
(사용 중단됨) |
[
first1
,
last1
)
로 정의되고 다른 하나는
[
first2
,
last2
)
로 정의됩니다.
요소들은 두 범위의 투영된 요소들에 대해 pred 를 사용하여 비교되며, 마치 ranges:: invoke ( pred, ranges:: invoke ( proj1, * i ) , ranges:: invoke ( proj2, * j ) ) 와 같이 수행됩니다.
위에 기술된 선언들과는 별개로, 알고리즘 선언의 실제 템플릿 매개변수 개수와 순서는 명시되지 않습니다. 따라서 알고리즘을 호출할 때 명시적 템플릿 인자를 사용하는 경우, 해당 프로그램은 이식성이 없을 가능성이 높습니다.
목차 |
매개변수
| first1, last1 | - | 첫 번째 요소 범위 |
| r1 | - | 첫 번째 요소 범위 |
| first2, last2 | - | 두 번째 요소 범위 |
| r2 | - | 두 번째 요소 범위 |
| first2_ | - | 두 번째 요소 범위의 시작점 |
| pred | - | 투영된 요소에 적용할 조건자 |
| proj1 | - | 첫 번째 범위의 요소에 적용할 투영 |
| proj2 | - | 두 번째 범위의 요소에 적용할 투영 |
반환값
첫 두 개의 동일하지 않은 요소에 대한 반복자를 가진
tagged_pair
객체 (첫 번째 범위의 반복자는
in1
태그를 가지고, 두 번째 범위의 반복자는
in2
태그를 가짐).
비교가 last1 또는 last2 에 도달할 때까지 불일치가 발견되지 않으면, 해당 쌍은 종료 반복자와 다른 범위의 해당 반복자를 보유합니다.
복잡도
최대 last1 - first1 번의 predicate 및 각 projection 적용.
가능한 구현
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}; } |
예제
|
이 섹션은 불완전합니다
이유: 예제가 없음 |
참고 항목
|
두 범위가 처음으로 달라지는 위치를 찾음
(function template) |
|
|
두 원소 집합이 동일한지 결정
(function template) |
|
|
특정 기준을 만족하는 첫 번째 원소를 찾음
(function template) |
|
|
true
를 반환함 - 한 범위가 다른 범위보다 사전순으로 작은 경우
(function template) |
|
|
원소들의 범위를 검색
(function template) |