Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Function template adaptive_sort

boost::movelib::adaptive_sort

Synopsis

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


template<std::size_t StackBytes, typename RandIt, typename RandRawIt, 
         typename Compare> 
  void adaptive_sort(RandIt first, RandIt last, Compare comp, 
                     RandRawIt uninitialized, 
                     typename iter_size< RandIt >::type uninitialized_len);

Description

Effects: Same as the overloads above, but "StackBytes" bytes of stack are used as the internal buffer whenever that is bigger than the supplied storage. Since it is a constant amount of memory, the O(1) extra memory guarantee is preserved. Small sorts are several times faster with it, because they can avoid the block based algorithm altogether.

Parameters:

  • StackBytes: size in bytes of the stack buffer. It must be given explicitly. Zero disables the stack buffer, and so does a value_type bigger than "StackBytes".

Caution: Experimental implementation, not production-ready.


PrevUpHomeNext