| Home | Libraries | People | FAQ | More

## Function template unique

boost::movelib::unique

## Synopsis

    // In header: <boost/move/algo/unique.hpp>

    template<typename ForwardIterator, typename BinaryPredicate>
      ForwardIterator
      unique(ForwardIterator first, ForwardIterator last, BinaryPredicate pred);

## Description

Requires: The comparison function shall be an equivalence relation. The type of *first shall satisfy the MoveAssignable requirements

Effects: For a nonempty range, eliminates all but the first element from every consecutive group of equivalent elements referred to by the iterator i in the range [first + 1, last) for which the following conditions hold: pred(*(i - 1), *i) != false.

Returns: The end of the resulting range.

Complexity: For nonempty ranges, exactly (last - first) - 1 applications of the corresponding predicate.