10 // Both these functions should ideally be placed into namespace lyx.
11 // Also the using std::less should not be used.
15 /// Returns true if the sequence first,last is sorted, false if not.
17 bool sorted(For first, For last)
19 if (first == last) return true;
21 while (++tmp != last) {
22 if (less(*tmp, *first++)) return false;
27 /// Cmp is the same Cmp as you would pass to std::sort.
28 template <class For, class Cmp>
29 bool sorted(For first, For last, Cmp cmp)
31 if (first == last) return true;
33 while (++tmp != last) {
34 if (cmp(*tmp, *first++)) return false;
39 // } // end of namespace lyx