8 /// Returns true if the sequence first,last is sorted, false if not.
10 bool sorted(For first, For last)
12 if (first == last) return true;
14 while (++tmp != last) {
15 if (*tmp < *first++) return false;
20 /// Cmp is the same Cmp as you would pass to std::sort.
21 template <class For, class Cmp>
22 bool sorted(For first, For last, Cmp cmp)
24 if (first == last) return true;
26 while (++tmp != last) {
27 if (cmp(*tmp, *first++)) return false;
32 // } // end of namespace lyx