]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/range/doc/reference/algorithm/unique_copy.qbk
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / range / doc / reference / algorithm / unique_copy.qbk
CommitLineData
7c673cae
FG
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:unique_copy unique_copy]
7
8[heading Prototype]
9
10``
11template<class SinglePassRange, class OutputIterator>
12OutputIterator unique_copy(const SinglePassRange& rng, OutputIterator out);
13
14template<class SinglePassRange, class OutputIterator, class BinaryPredicate>
15OutputIterator unique_copy(const SinglePassRange& rng, OutputIterator out, BinaryPredicate pred);
16``
17
18[heading Description]
19
20`unique_copy` copies the first element of each sequence of duplicates encountered in `rng` to `out`.
21
22Equality is determined by the predicate if one is supplied, or by `operator==()` for `SinglePassRange`'s value type.
23
24[heading Definition]
25
26Defined in the header file `boost/range/algorithm/unique_copy.hpp`
27
28[heading Requirements]
29
30[*For the non-predicate versions of unique:]
31
32* `SinglePassRange` is a model of the __single_pass_range__ Concept.
33* `SinglePassRange` is mutable.
34* `SinglePassRange`'s value type is a model of the `EqualityComparableConcept`.
35* `OutputIterator` is a model of the `OutputIteratorConcept`.
36
37[*For the predicate versions of unique:]
38
39* `SinglePassRange` is a model of the __single_pass_range__ Concept.
40* `SinglePassRange` is mutable.
41* `BinaryPredicate` is a model of the `BinaryPredicateConcept`.
42* `SinglePassRange`'s value type is convertible to `BinaryPredicate`'s first argument type and to `BinaryPredicate`'s second argument type.
43* `OutputIterator` is a model of the `OutputIteratorConcept`.
44
45[heading Complexity]
46
47Linear. `O(N)` where `N` is `distance(rng)`. Exactly `distance(rng)` comparisons are performed.
48
49[endsect]