다음을 통해 공유


is_sorted

Returns true if the elements in the specified range are in sorted order.

template<class ForwardIterator>
    bool is_sorted(
        ForwardIterator _First, 
        ForwardIterator _Last
    );
template<class ForwardIterator, class BinaryPredicate>
    bool is_sorted(
        ForwardIterator _First, 
        ForwardIterator _Last, 
        BinaryPredicate _Comp
    );

매개 변수

  • _First
    A forward iterator that indicates where the range to check begins.

  • _Last
    A forward iterator that indicates the end of a range.

  • _Comp
    The condition to test to determine an order between two elements. A predicate takes a single argument and returns true or false. This performs the same task as operator<.

속성 값/반환 값

Returns true if the elements within the specified range are in sorted order, false if they're not.

설명

The first template function returns is_sorted_until(_First, _Last) == _Last. The operator< function performs the order comparison.

The second template function returns is_sorted_until(_First, _Last, _Comp) == _Last. The _Comp predicate function performs the order comparison.

요구 사항

헤더: <algorithm>

네임스페이스: std

참고 항목

참조

is_sorted_until

<algorithm>

표준 템플릿 라이브러리