| Home | Libraries | People | FAQ | More

## Function template spreadsort

boost::sort::spreadsort::spreadsort — Generic `spreadsort` variant detecting string element type so call to `string_sort` for `std::strings` and `std::wstrings`.

## Synopsis

    // In header: <boost/sort/spreadsort/spreadsort.hpp>

    template<typename RandomAccessIter>
      boost::enable_if_c< is_same< typename std::iterator_traits< RandomAccessIter >::value_type, typename std::string >::value||is_same< typename std::iterator_traits< RandomAccessIter >::value_type, typename std::wstring >::value, void >::type
      spreadsort(RandomAccessIter first, RandomAccessIter last);

## Description

If the data type provided is a string or wstring, `string_sort` is used.

| Note
Sorting other data types requires picking between `integer_sort`, `float_sort` and `string_sort` directly, as `spreadsort` won't accept types that don't have the appropriate `type_traits`.

Parameters:

`first` | Iterator pointer to first element.
`last` | Iterator pointing to one beyond the end of data.

Requires: | [`first`, `last`) is a valid range.
Requires: | `RandomAccessIter` `value_type` is mutable.
Requires: | `RandomAccessIter` `value_type` is LessThanComparable
Requires: | `RandomAccessIter` `value_type` supports the `operator>>`, which returns an integer-type right-shifted a specified number of bits.
Postconditions: | The elements in the range [`first`, `last`) are sorted in ascending order.