[#absl-c_lexicographical_compare-08]
= xref:absl.adoc[absl]::c&lowbar;lexicographical&lowbar;compare
:relfileprefix: ../
:mrdocs:

`c&lowbar;lexicographical&lowbar;compare` 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;lexicographical&lowbar;compare()` function to lexicographically compare (e&period;g&period; sort words alphabetically) two container sequences&period; The comparison is performed using `operator&lt;`&period; Note that capital letters (&quot;A&hyphen;Z&quot;) have ASCII values less than lowercase letters (&quot;a&hyphen;z&quot;)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename Sequence1,
    typename Sequence2&gt;
constexpr
bool
xref:absl/c_lexicographical_compare-06.adoc[c&lowbar;lexicographical&lowbar;compare](
    Sequence1 const& sequence1,
    Sequence2 const& sequence2);
----

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

Overload of `c&lowbar;lexicographical&lowbar;compare()` for performing a lexicographical comparison using a `comp` operator instead of `operator&lt;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename Sequence1,
    typename Sequence2,
    typename LessThan&gt;
constexpr
bool
xref:absl/c_lexicographical_compare-05.adoc[c&lowbar;lexicographical&lowbar;compare](
    Sequence1 const& sequence1,
    Sequence2 const& sequence2,
    LessThan&& comp);
----

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

== Return Value

* `true` if `sequence1` is lexicographically less than `sequence2`, otherwise `false`&period;
* `true` if `sequence1` is lexicographically less than `sequence2` under `comp`, otherwise `false`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *sequence1*
| The first container&period;
| *sequence2*
| The second container&period;
| *comp*
| The comparison used to order the elements&period;
|===


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