Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Function template adaptive_merge

boost::movelib::adaptive_merge

Synopsis

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


template<std::size_t StackBytes, typename RandIt, typename Compare> 
  void adaptive_merge(RandIt first, RandIt middle, RandIt last, Compare comp, 
                      typename iterator_traits< RandIt >::value_type * uninitialized = 0, 
                      typename iter_size< RandIt >::type uninitialized_len = 0);

Description

Effects: Same as the overload 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 merges 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