1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
hi(unique)
itemization(
it() Header file: tt(<algorithm>)
it() Function prototypes:
itemization(
itt(ForwardIterator unique([ExecPol,] ForwardIterator first,
ForwardIterator last);)
itt(ForwardIterator unique([ExecPol,] ForwardIterator first,
ForwardIterator last, BinaryPredicate pred);)
itt(OutputIterator unique_copy([ExecPol,] InputIterator first,
InputIterator last, OutputIterator result);)
itt(OutputIterator unique_copy([ExecPol,] InputIterator first,
InputIterator last, OutputIterator result, BinaryPredicate pred);)
)
it() Description:nl()
The tt(std::unique) generic algorithm assumes that the elements in the
range have previously been sorted (cf. section ref(SORT)).
itemization(
it() The first prototype: using ti(operator==) of the data type to
which the iterators point, all but the first of consecutively equal elements
in the range pointed to by rangett(first, last) are relocated to the end of
the range. The returned forward iterator marks the beginning of the
emi(leftover). All elements in the range rangett(first, return-value) are
unique, all elements in the range rangett(return-value, last) have
undetermined (but valid) values.
it() The second prototype: all but the first of consecutive
elements in the range pointed to by rangett(first, last) for which the binary
predicate tt(pred) returns tt(true) are relocated to the end of the range. The
predicate tt(pred) expects two arguments of the data type to which the
iterators point. The returned forward iterator marks the beginning of the
emi(leftover). For all pairs of elements in the range rangett(first,
return-value) tt(pred) returns tt(false) (i.e., they are em(unique)). All
elements in the em(leftover) (i.e., the range rangett(return-value, last))
have undetermined (but valid) values.
)
it() Example:
verbinclude(-a examples/unique.cc)
)
|