11 /// Returns true if the sequence first,last is sorted, false if not.
13 bool sorted(For first, For last)
15 if (first == last) return true;
17 while (++tmp != last) {
18 if (*tmp < *first++) return false;
24 /// Cmp is the same Cmp as you would pass to std::sort.
25 template <class For, class Cmp>
26 bool sorted(For first, For last, Cmp cmp)
28 if (first == last) return true;
30 while (++tmp != last) {
31 if (cmp(*tmp, *first++)) return false;
38 template <class P1, class P2>
39 P1 operator()(std::pair<P1, P2> const & p) {
45 template <class InputIter, class OutputIter, class Func>
46 OutputIter copy_if(InputIter first, InputIter last,
47 OutputIter result, Func func)
49 for (; first != last; ++first) {
57 } // end of namespace lyx