| Home | Libraries | People | FAQ | More

## Function template stable_sort_by_key

boost::compute::stable_sort_by_key

## Synopsis

    // In header: <boost/compute/algorithm/stable_sort_by_key.hpp>

    template<typename KeyIterator, typename ValueIterator, typename Compare>
      void stable_sort_by_key(KeyIterator keys_first, KeyIterator keys_last,
                              ValueIterator values_first, Compare compare,
                              command_queue & queue = system::default_queue());

## Description

Performs a key-value stable sort using the keys in the range [`keys_first`, `keys_last`) on the values in the range [`values_first`, `values_first` `+` (`keys_last` `-` `keys_first`)) using `compare`.

If no compare function is specified, `less` is used.

Space complexity: \Omega(2n)

See Also: sort()