[#absl-c_nth_element-09]
= xref:absl.adoc[absl]::c&lowbar;nth&lowbar;element
:relfileprefix: ../
:mrdocs:

`c&lowbar;nth&lowbar;element` 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;nth&lowbar;element()` function to rearrange the elements within a container such that the `nth` element would be in that position in an ordered sequence&semi; other elements may be in any order, except that all preceding `nth` will be less than that element, and all following `nth` will be greater than that element&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename RandomAccessContainer&gt;
constexpr
void
xref:absl/c_nth_element-07.adoc[c&lowbar;nth&lowbar;element](
    RandomAccessContainer& sequence,
    &sol;&ast; implementation-defined &ast;&sol; nth);
----

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

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename RandomAccessContainer,
    typename LessThan&gt;
constexpr
void
xref:absl/c_nth_element-08.adoc[c&lowbar;nth&lowbar;element](
    RandomAccessContainer& sequence,
    &sol;&ast; implementation-defined &ast;&sol; nth,
    LessThan&& comp);
----

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *sequence*
| The container to rearrange&period;
| *nth*
| An iterator to the element to place in its sorted position&period;
| *comp*
| The comparison used to order the elements&period;
|===


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