]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/range/doc/reference/algorithm_ext/is_sorted.qbk
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / range / doc / reference / algorithm_ext / is_sorted.qbk
1 [/
2 Copyright 2010 Neil Groves
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 /]
6 [section:is_sorted is_sorted]
7
8 [heading Prototype]
9
10 ``
11 template<class SinglePassRange>
12 bool is_sorted(const SinglePassRange& rng);
13
14 template<class SinglePassRange, class BinaryPredicate>
15 bool is_sorted(const SinglePassRange& rng, BinaryPredicate pred);
16 ``
17
18 [heading Description]
19
20 `is_sorted` determines if a range is sorted.
21 For the non-predicate version the return value is `true` if and only if for
22 each adjacent elements `[x,y]` the expression `x < y` is `true`.
23 For the predicate version the return value is `true` is and only if for each
24 adjacent elements `[x,y]` the expression `pred(x,y)` is `true`.
25
26 [heading Definition]
27
28 Defined in the header file `boost/range/algorithm_ext/is_sorted.hpp`
29
30 [heading Requirements]
31
32 # `SinglePassRange` is a model of the __single_pass_range__ Concept.
33 # `BinaryPredicate` is a model of the `BinaryPredicate` Concept.
34 # The value type of `SinglePassRange` is convertible to both argument types of `BinaryPredicate`.
35
36 [heading Complexity]
37
38 Linear. A maximum of `distance(rng)` comparisons are performed.
39
40 [endsect]