boost的函数:is

    xiaoxiao2021-03-25  116

    is_sorted_until函数源码 template <typename ForwardIterator, typename Pred> ForwardIterator is_sorted_until ( ForwardIterator first, ForwardIterator last, Pred p ) { if ( first == last ) return last; // the empty sequence is ordered ForwardIterator next = first; while ( ++next != last ) { if ( p ( *next, *first )) return next; first = next; } return last; }

    本文件的最底层实现为is_sorted_until函数,其他函数都是通过间接调用此函数实现函数功能。

     (1) is_sortedis_increasing的Pred参数为C++的标准模板函数less

     (2) is_decreasing的Pred参数为C++的标准模板函数greater

     (3) is_strictly_increasing的Pred参数为C++的标准模板函数less_equal;

     (4) is_strictly_decreasing的Pred参数为C++的标准模板函数greater_equal.

    转载请注明原文地址: https://ju.6miu.com/read-9302.html

    最新回复(0)