cuda::experimental::stf::unstable_unique

Defined in include/cuda/experimental/__stf/utility/unstable_unique.cuh

template<class iterator>
iterator cuda::experimental::stf::unstable_unique(iterator first, iterator last)

Removes duplicates from a range using the built-in operator==.

This function operates like unstable_unique above with operator== as the predicate.

Example:

::std::vector<int> v = {1, 1, 2, 2, 3, 3, 4, 4, 5, 5};
auto new_end = unstable_unique(v.begin(), v.end());
v.erase(new_end, v.end());
// v is now {1, 5, 2, 4, 3, 5}

Template Parameters

iterator – The type of the iterator.

Parameters

first, last – The range of elements to remove duplicates from.

Returns

iterator The new end of the range after duplicates have been removed.