[#absl-c_partial_sort_copy-022]
= xref:absl.adoc[absl]::c&lowbar;partial&lowbar;sort&lowbar;copy
:relfileprefix: ../
:mrdocs:

`c&lowbar;partial&lowbar;sort&lowbar;copy` overloads

== Synopses

Declared in `&lt;absl&sol;algorithm&sol;container&period;h&gt;`

Container&hyphen;based version of the &lt;algorithm&gt; `std&colon;&colon;partial&lowbar;sort&lowbar;copy()` function to sort the elements in the given range `result` within the larger `sequence` in ascending order (and using `result` as the output parameter)&period; At most min(result&period;last &hyphen; result&period;first, sequence&period;last &hyphen; sequence&period;first) elements from the sequence will be stored in the result&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename C,
    typename RandomAccessContainer&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
xref:absl/c_partial_sort_copy-020.adoc[c&lowbar;partial&lowbar;sort&lowbar;copy](
    C const& sequence,
    RandomAccessContainer& result);
----

[.small]#xref:absl/c_partial_sort_copy-020.adoc[_» more&period;&period;&period;_]#

Overload of `c&lowbar;partial&lowbar;sort&lowbar;copy()` for performing a `comp` comparison other than the default `operator&lt;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename C,
    typename RandomAccessContainer,
    typename LessThan&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;
xref:absl/c_partial_sort_copy-04.adoc[c&lowbar;partial&lowbar;sort&lowbar;copy](
    C const& sequence,
    RandomAccessContainer& result,
    LessThan&& comp);
----

[.small]#xref:absl/c_partial_sort_copy-04.adoc[_» more&period;&period;&period;_]#

== Return Value

An iterator to the end of the range written in `result`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *sequence*
| The container whose elements to sort&period;
| *result*
| The destination container receiving the sorted elements&period;
| *comp*
| The comparison used to order the elements&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
