partial_sort_copy [C++ Reference]
Keywords: stl,algorithm,partial_sort_copy
Date: 2009-10-09T01:47:27-0700

[[partial_sort_copy]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- fr
- it
- jp
- pl
- ru
- tr

## partial_sort_copy

Syntax:

        #include <algorithm>
        random_iterator partial_sort_copy( input_iterator start, input_iterator end, random_iterator result_start, random_iterator result_end );
        random_iterator partial_sort_copy( input_iterator start, input_iterator end, random_iterator result_start, random_iterator result_end, StrictWeakOrdering cmp );

The partial_sort_copy() algorithm behaves like partial_sort(), except that instead of partially sorting the range in-place, a copy of the range is created and the sorting takes place in the copy. The initial range is defined by [start,end) and the location of the copy is defined by [result_start,result_end).

partial_sort_copy() returns an iterator to the end of the copied, partially- sorted range of elements.

Related Topics: binary_search, is_sorted, partial_sort, sort, stable_sort

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •