|
template<typename ForwardIterator > |
ForwardIterator | bolt::amp::unique (control &ctl, ForwardIterator first, ForwardIterator last) |
|
template<typename ForwardIterator > |
ForwardIterator | bolt::amp::unique (ForwardIterator first, ForwardIterator last) |
|
template<typename ForwardIterator , typename BinaryPredicate > |
ForwardIterator | bolt::amp::unique (control &ctl, ForwardIterator first, ForwardIterator last, BinaryPredicate binary_pred) |
|
template<typename ForwardIterator , typename BinaryPredicate > |
ForwardIterator | bolt::amp::unique (ForwardIterator first, ForwardIterator last, BinaryPredicate binary_pred) |
|
template<typename InputIterator , typename OutputIterator > |
OutputIterator | bolt::amp::unique_copy (control &ctl, InputIterator first, InputIterator last, OutputIterator output) |
|
template<typename InputIterator , typename OutputIterator > |
OutputIterator | bolt::amp::unique_copy (InputIterator first, InputIterator last, OutputIterator output) |
|
template<typename InputIterator , typename OutputIterator , typename BinaryPredicate > |
OutputIterator | bolt::amp::unique_copy (control &ctl, InputIterator first, InputIterator last, OutputIterator output, BinaryPredicate binary_pred) |
|
template<typename InputIterator , typename OutputIterator , typename BinaryPredicate > |
OutputIterator | bolt::amp::unique_copy (InputIterator first, InputIterator last, OutputIterator output, BinaryPredicate binary_pred) |
|
template<typename ForwardIterator >
ForwardIterator bolt::amp::unique |
( |
control & |
ctl, |
|
|
ForwardIterator |
first, |
|
|
ForwardIterator |
last |
|
) |
| |
This version of unique
removes all but the first element of the group in a group of consecutive elements in the range [first, last) with the same value. The return value is an iterator new_last such that no two consecutive elements in the range [first, new_last) are equal. unique_copy
copies elements from the range [first, last) to a range beginning with output, except that in a consecutive group of duplicate elements only the first one is copied. The return value is the end of the range to which the elements are copied.
- Parameters
-
ctl | Optional Control structure to control accelerator, debug, tuning, etc.See bolt::amp::control. |
first | The beginning of the first input sequence. |
last | The end of the first input sequence. |
pred | The predicate to test on every value of the range [first,last). |
- Returns
- ForwardIterator or OutputIterator
- Template Parameters
-
ForwardIterator | is a model of InputIterator and InputIterator's value_type is convertible to UnaryFunction's |
The following code snippet demonstrates how to use replace
and replace_if
.
int input1[10] = {-5, 0, 0, 3, 3, 3, 3, 1, 1, 1};
int input2[10] = {-5, 0, 0, 3, 3, 3, 3, 1, 1, 1};
int output[10];
::Concurrency::accelerator accel(::Concurrency::accelerator::default_accelerator);
- See Also
- http://www.sgi.com/tech/stl/unique.html