Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Function template partition_copy



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

template<typename InputIterator, typename OutputIterator1, 
         typename OutputIterator2, typename UnaryPredicate> 
  std::pair< OutputIterator1, OutputIterator2 > 
  partition_copy(InputIterator first, InputIterator last, 
                 OutputIterator1 first_true, OutputIterator2 first_false, 
                 UnaryPredicate predicate, 
                 command_queue & queue = system::default_queue());


Copies all of the elements in the range [first, last) for which predicate returns true to the range beginning at first_true and all of the elements for which predicate returns false to the range beginning at first_false.

Space complexity: (2n)

See Also: