std::experimental::ranges:: find, std::experimental::ranges:: find_if, std::experimental::ranges:: find_if_not
|
헤더 파일에 정의됨
<experimental/ranges/algorithm>
|
||
|
template
<
InputIterator I, Sentinel
<
I
>
S,
class
T,
class
Proj
=
ranges::
identity
>
requires IndirectRelation
<
ranges::
equal_to
<>
,
projected
<
I, Proj
>
,
const
T
*
>
|
(1) | (ranges TS) |
|
template
<
InputRange R,
class
T,
class
Proj
=
ranges::
identity
>
requires IndirectRelation
<
ranges::
equal_to
<>
,
|
(2) | (ranges TS) |
|
template
<
InputIterator I, Sentinel
<
I
>
S,
class
Proj
=
ranges::
identity
,
IndirectUnaryPredicate
<
projected
<
I, Proj
>>
Pred
>
|
(3) | (ranges TS) |
|
template
<
InputRange R,
class
Proj
=
ranges::
identity
,
IndirectUnaryPredicate
<
projected
<
ranges::
iterator_t
<
R
>
, Proj
>>
Pred
>
|
(4) | (ranges TS) |
|
template
<
InputIterator I, Sentinel
<
I
>
S,
class
Proj
=
ranges::
identity
,
IndirectUnaryPredicate
<
projected
<
I, Proj
>>
Pred
>
|
(5) | (ranges TS) |
|
template
<
InputRange R,
class
Proj
=
ranges::
identity
,
IndirectUnaryPredicate
<
projected
<
ranges::
iterator_t
<
R
>
, Proj
>>
Pred
>
|
(6) | (ranges TS) |
범위
[
first
,
last
)
내에서 특정 조건을 만족하는 첫 번째 요소를 반환합니다:
find_if
는 투영된 값에 대해 조건자
p
가
true
를 반환하는 요소를 검색합니다
(즉,
ranges::
invoke
(
pred,
ranges::
invoke
(
proj,
*
i
)
)
)가
true
인 경우).
find_if_not
는 투영된 값에 대해 조건자
q
가
false
를 반환하는 요소를 검색합니다 (즉,
ranges::
invoke
(
pred,
ranges::
invoke
(
proj,
*
i
)
)
)가
false
인 경우).
위에 설명된 선언들과는 별개로, 알고리즘 선언에 대한 실제 템플릿 매개변수의 개수와 순서는 명시되지 않습니다. 따라서 알고리즘을 호출할 때 명시적 템플릿 인수를 사용하는 경우, 해당 프로그램은 이식성이 없을 가능성이 높습니다.
목차매개변수
반환값조건을 만족하는 첫 번째 요소에 대한 반복자. 해당하는 요소가 없으면 last 와 동일하게 비교되는 반복자를 반환합니다. 복잡도최대 last - first 번의 predicate 및 projection 적용. 가능한 구현
예제
참고
|