| Home | Libraries | People | FAQ | More

## Function sort_by_key

boost::compute::sort_by_key

## Synopsis

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

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

## Description

Performs a key-value 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()