다음을 통해 공유


is_partitioned

Returns true if all the elements in the given range that test true for a condition come before any elements that test false.

template<class InputIterator, class BinaryPredicate>
    bool is_partitioned(
        InputIterator _First, 
        InputIterator _Last,
        BinaryPredicate _Comp
    );

매개 변수

  • _First
    An input iterator that indicates where a range starts to check for a condition.

  • _Last
    An input iterator that indicates the end of a range.

  • _Comp
    The condition to test for. This is provided by a user-defined predicate function object that defines the condition to be satisfied by the element being searched for. A predicate takes a single argument and returns trueor false.

반환 값

Returns true when all of the elements in the given range that test true for a condition come before any elements that test false, and otherwise returns false.

설명

The template function returns true only if all elements in [_First, _Last) are partitioned by _Comp; that is, all elements X in [_First, _Last) for which _Comp(X) is true occur before all elements Y for which _Comp(Y) is false.

요구 사항

헤더: <algorithm>

네임스페이스: std

참고 항목

참조

is_sorted

is_sorted_until

partition_point

partition_copy

<algorithm>

표준 템플릿 라이브러리