mirror of
https://github.com/boostorg/range.git
synced 2025-07-29 12:27:42 +02:00
Boost.Range documentation update iteration.
[SVN r61647]
This commit is contained in:
44
doc/reference/algorithm/unique_copy.qbk
Normal file
44
doc/reference/algorithm/unique_copy.qbk
Normal file
@ -0,0 +1,44 @@
|
||||
[section:unique_copy unique_copy]
|
||||
|
||||
[heading Prototype]
|
||||
|
||||
``
|
||||
template<class SinglePassRange, class OutputIterator>
|
||||
OutputIterator unique_copy(const SinglePassRange& rng, OutputIterator out);
|
||||
|
||||
template<class SinglePassRange, class OutputIterator, class BinaryPredicate>
|
||||
OutputIterator unique_copy(const SinglePassRange& rng, OutputIterator out, BinaryPredicate pred);
|
||||
``
|
||||
|
||||
[heading Description]
|
||||
|
||||
`unique_copy` copies the first element of each sequence of duplicates encountered in `rng` to `out`.
|
||||
|
||||
Equality is determined by the predicate if one is supplied, or by `operator==()` for `SinglePassRange`'s value type.
|
||||
|
||||
[heading Definition]
|
||||
|
||||
Defined in the header file `boost/range/algorithm/unique_copy.hpp`
|
||||
|
||||
[heading Requirements]
|
||||
|
||||
[*For the non-predicate versions of unique:]
|
||||
|
||||
* `SinglePassRange` is a model of the __single_pass_range__ Concept.
|
||||
* `SinglePassRange` is mutable.
|
||||
* `SinglePassRange`'s value type is a model of the `EqualityComparableConcept`.
|
||||
* `OutputIterator` is a model of the `OutputIteratorConcept`.
|
||||
|
||||
[*For the predicate versions of unique:]
|
||||
|
||||
* `SinglePassRange` is a model of the __single_pass_range__ Concept.
|
||||
* `SinglePassRange` is mutable.
|
||||
* `BinaryPredicate` is a model of the `BinaryPredicateConcept`.
|
||||
* `SinglePassRange`'s value type is convertible to `BinaryPredicate`'s first argument type and to `BinaryPredicate`'s second argument type.
|
||||
* `OutputIterator` is a model of the `OutputIteratorConcept`.
|
||||
|
||||
[heading Complexity]
|
||||
|
||||
Linear. `O(N)` where `N` is `distance(rng)`. Exactly `distance(rng)` comparisons are performed.
|
||||
|
||||
[endsect]
|
Reference in New Issue
Block a user