std::ranges::take_while_view<V,Pred>:: pred
From cppreference.net
<
cpp
|
ranges
|
take while view
C++
Ranges library
|
||||||||||||||||||||||
| Range primitives | |||||||
|
|||||||
| Range concepts | |||||||||||||||||||
|
|||||||||||||||||||
| Range factories | |||||||||
|
|||||||||
| Range adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||
| Helper items | |||||||||||||||||
|
|
||||||||||||||||
|
constexpr
const
Pred
&
pred
(
)
const
;
|
(C++20 이후) | |
저장된 술어에 대한 참조를 반환합니다
pred_
.
만약
*
this
가 predicate을 저장하지 않는 경우(예:
*
this
에 대한 할당 시 예외가 발생하여
Pred
의 복사 생성 또는 이동 생성이 실패하는 경우), 동작은 정의되지 않습니다.
목차 |
매개변수
(없음)
반환값
저장된 술어에 대한 참조입니다.
예제
이 코드 실행
#include <ranges> int main() { static constexpr int a[]{1, 2, 3, 4, 5}; constexpr auto v = a | std::views::take_while([](int x){ return x < 4; }); const auto pred = v.pred(); static_assert(pred(3)); }
참고 항목
|
기본(적응된) 뷰의 사본을 반환합니다
(public member function) |