共用方式為


is_sorted

如果在指定的範圍的項目依排序順序,傳回 true 。

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
    表示的順向 Iterator 檢查這個範圍的開始位置。

  • _Last
    指示範圍結尾的順向 Iterator。

  • _Comp
    負責判斷在兩個項目之間的命令之測試的條件。 述詞會採用單一引數並傳回 true 或 false。 此執行緒的工作和 operator<相同。

屬性值/傳回值

傳回 true ,如果在指定的範圍內的項目依排序順序, false ,若尚未安裝。

備註

第一個樣板函式傳回 is_sorted_until(_First,_Last) ==_Last。 operator<函式執行命令來比較。

第二個樣板函式傳回 is_sorted_until(_First,_Last,_Comp) ==_Last。 _Comp 述詞函式執行命令來比較。

需求

標題: <algorithm>

命名空間: std

請參閱

參考

is_sorted_until

<algorithm>

標準樣板程式庫