Namespaces
Variants

std::ranges::take_while_view<V,Pred>::pred

cppreference.net에서 가져옴
 
 
Ranges 라이브러리
Range 어댑터
 
 
constexpr const Pred& pred() const;
(C++20부터)

저장된 조건자(predicate)에 대한 참조를 반환합니다pred_.

만약 *this 조건자를 저장하지 않는 경우 (예: *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)