[#bsl-operator_3way-0f1]
= xref:bsl.adoc[bsl]::operator&lt;&equals;&gt;
:relfileprefix: ../
:mrdocs:

Three&hyphen;way comparison operators

== Synopses

Declared in `&lt;bslstl&lowbar;deque&period;h&gt;`

Return the lexicographic three&hyphen;way comparison of `lhs` and `rhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class KEY,
    class COMPARATOR,
    class ALLOCATOR&gt;
xref:BloombergLP/bslalg/SynthThreeWayUtil/Result.adoc[BloombergLP::bslalg::SynthThreeWayUtil::Result&lt;KEY&gt;]
xref:bsl/operator_3way-0ff.adoc[operator&lt;&equals;&gt;](
    xref:bsl/multiset-03.adoc[multiset&lt;KEY, COMPARATOR, ALLOCATOR&gt;] const& lhs,
    xref:bsl/multiset-03.adoc[multiset&lt;KEY, COMPARATOR, ALLOCATOR&gt;] const& rhs);
----

[.small]#xref:bsl/operator_3way-0ff.adoc[_» more&period;&period;&period;_]#

Perform a lexicographic three&hyphen;way comparison of `lhs` and `rhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class VALUE,
    class ALLOCATOR&gt;
xref:BloombergLP/bslalg/SynthThreeWayUtil/Result.adoc[BloombergLP::bslalg::SynthThreeWayUtil::Result&lt;VALUE&gt;]
xref:bsl/operator_3way-0f6.adoc[operator&lt;&equals;&gt;](
    xref:bsl/list-054.adoc[list&lt;VALUE, ALLOCATOR&gt;] const& lhs,
    xref:bsl/list-054.adoc[list&lt;VALUE, ALLOCATOR&gt;] const& rhs);
----

[.small]#xref:bsl/operator_3way-0f6.adoc[_» more&period;&period;&period;_]#

Return the three&hyphen;way comparison result of `lhs` and `rhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class VALUE,
    three&lowbar;way&lowbar;comparable CONTAINER&gt;
compare&lowbar;three&lowbar;way&lowbar;result&lowbar;t&lt;CONTAINER&gt;
xref:bsl/operator_3way-08d.adoc[operator&lt;&equals;&gt;](
    xref:bsl/queue-0a5.adoc[queue&lt;VALUE, CONTAINER&gt;] const& lhs,
    xref:bsl/queue-0a5.adoc[queue&lt;VALUE, CONTAINER&gt;] const& rhs);
----

[.small]#xref:bsl/operator_3way-08d.adoc[_» more&period;&period;&period;_]#

Return the three&hyphen;way comparison of the specified queues&semi; see the non&hyphen;member `operator&lt;&equals;&gt;` in the `bsl` namespace&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
compare&lowbar;three&lowbar;way&lowbar;result&lowbar;t&lt;CONTAINER2&gt;
xref:bsl/operator_3way-036.adoc[operator&lt;&equals;&gt;](
    xref:bsl/queue-0a5.adoc[queue&lt;VALUE2, CONTAINER2&gt;] const& lhs,
    xref:bsl/queue-0a5.adoc[queue&lt;VALUE2, CONTAINER2&gt;] const& rhs);
----

[.small]#xref:bsl/operator_3way-036.adoc[_» more&period;&period;&period;_]#

Return the three&hyphen;way comparison result of `lhs` and `rhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; t&lowbar;ALTS&gt;
requires (std&colon;&colon;three&lowbar;way&lowbar;comparable&lt;t&lowbar;ALTS&gt; &amp;&amp; &period;&period;&period;)
constexpr
std::common&lowbar;comparison&lowbar;category&lowbar;t&lt;std::compare&lowbar;three&lowbar;way&lowbar;result&lowbar;t&lt;t&lowbar;ALTS&gt;&period;&period;&period;&gt;
xref:bsl/operator_3way-09.adoc[operator&lt;&equals;&gt;](
    xref:bsl/variant.adoc[variant&lt;t&lowbar;ALTS&period;&period;&period;&gt;] const& lhs,
    xref:bsl/variant.adoc[variant&lt;t&lowbar;ALTS&period;&period;&period;&gt;] const& rhs);
----

[.small]#xref:bsl/operator_3way-09.adoc[_» more&period;&period;&period;_]#

Return the three&hyphen;way comparison result of the specified `lhs` and `rhs` stacks by comparing their underlying containers&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class VALUE,
    three&lowbar;way&lowbar;comparable CONTAINER&gt;
compare&lowbar;three&lowbar;way&lowbar;result&lowbar;t&lt;CONTAINER&gt;
xref:bsl/operator_3way-01d.adoc[operator&lt;&equals;&gt;](
    xref:bsl/stack-05.adoc[stack&lt;VALUE, CONTAINER&gt;] const& lhs,
    xref:bsl/stack-05.adoc[stack&lt;VALUE, CONTAINER&gt;] const& rhs);
----

[.small]#xref:bsl/operator_3way-01d.adoc[_» more&period;&period;&period;_]#

Return the three&hyphen;way comparison of the specified stacks&semi; see the non&hyphen;member `operator&lt;&equals;&gt;` in the `bsl` namespace&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
compare&lowbar;three&lowbar;way&lowbar;result&lowbar;t&lt;CONT&gt;
xref:bsl/operator_3way-03e.adoc[operator&lt;&equals;&gt;](
    xref:bsl/stack-05.adoc[stack&lt;VAL, CONT&gt;] const& lhs,
    xref:bsl/stack-05.adoc[stack&lt;VAL, CONT&gt;] const& rhs);
----

[.small]#xref:bsl/operator_3way-03e.adoc[_» more&period;&period;&period;_]#

Perform a lexicographic three&hyphen;way comparison of `lhs` and `rhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class VALUE&lowbar;TYPE,
    class ALLOCATOR&gt;
xref:BloombergLP/bslalg/SynthThreeWayUtil/Result.adoc[BloombergLP::bslalg::SynthThreeWayUtil::Result&lt;VALUE&lowbar;TYPE&gt;]
xref:bsl/operator_3way-07cc.adoc[operator&lt;&equals;&gt;](
    xref:bsl/deque-0c.adoc[deque&lt;VALUE&lowbar;TYPE, ALLOCATOR&gt;] const& lhs,
    xref:bsl/deque-0c.adoc[deque&lt;VALUE&lowbar;TYPE, ALLOCATOR&gt;] const& rhs);
----

[.small]#xref:bsl/operator_3way-07cc.adoc[_» more&period;&period;&period;_]#

Perform a three&hyphen;way comparison of the operands&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;LHS,
    three&lowbar;way&lowbar;comparable&lowbar;with&lt;t&lowbar;LHS&gt; t&lowbar;RHS&gt;
constexpr
compare&lowbar;three&lowbar;way&lowbar;result&lowbar;t&lt;t&lowbar;LHS, t&lowbar;RHS&gt;
xref:bsl/operator_3way-0a.adoc[operator&lt;&equals;&gt;](
    xref:bsl/optional-072.adoc[bsl::optional&lt;t&lowbar;LHS&gt;] const& lhs,
    std::optional&lt;t&lowbar;RHS&gt; const& rhs);
----

[.small]#xref:bsl/operator_3way-0a.adoc[_» more&period;&period;&period;_]#

Perform a three&hyphen;way comparison of the operands&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;TYPE&gt;
constexpr
std::strong&lowbar;ordering
xref:bsl/operator_3way-0d1.adoc[operator&lt;&equals;&gt;](
    xref:bsl/optional-072.adoc[bsl::optional&lt;t&lowbar;TYPE&gt;] const& value,
    xref:bsl/nullopt_t.adoc[bsl::nullopt&lowbar;t] nullopt) noexcept;
----

[.small]#xref:bsl/operator_3way-0d1.adoc[_» more&period;&period;&period;_]#

Perform a three&hyphen;way comparison of the operands&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;LHS,
    class t&lowbar;RHS&gt;
requires (!BloombergLP&colon;&colon;bslstl&colon;&colon;Optional&lowbar;DerivedFromOptional&lt;t&lowbar;RHS&gt;) &amp;&amp;
         three&lowbar;way&lowbar;comparable&lowbar;with&lt;t&lowbar;LHS, t&lowbar;RHS&gt;
constexpr
compare&lowbar;three&lowbar;way&lowbar;result&lowbar;t&lt;t&lowbar;LHS, t&lowbar;RHS&gt;
xref:bsl/operator_3way-070.adoc[operator&lt;&equals;&gt;](
    xref:bsl/optional-072.adoc[bsl::optional&lt;t&lowbar;LHS&gt;] const& lhs,
    t&lowbar;RHS const& rhs);
----

[.small]#xref:bsl/operator_3way-070.adoc[_» more&period;&period;&period;_]#

Perform a three&hyphen;way comparison of the operands&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;LHS,
    three&lowbar;way&lowbar;comparable&lowbar;with&lt;t&lowbar;LHS&gt; t&lowbar;RHS&gt;
constexpr
compare&lowbar;three&lowbar;way&lowbar;result&lowbar;t&lt;t&lowbar;LHS, t&lowbar;RHS&gt;
xref:bsl/operator_3way-00.adoc[operator&lt;&equals;&gt;](
    xref:bsl/optional-072.adoc[bsl::optional&lt;t&lowbar;LHS&gt;] const& lhs,
    xref:bsl/optional-072.adoc[bsl::optional&lt;t&lowbar;RHS&gt;] const& rhs);
----

[.small]#xref:bsl/operator_3way-00.adoc[_» more&period;&period;&period;_]#

Compare the specified `lhs` and `rhs` pairs lexicographically&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class T1,
    class T2&gt;
constexpr
std::common&lowbar;comparison&lowbar;category&lowbar;t&lt;BloombergLP::bslalg::SynthThreeWayUtil::Result&lt;T1&gt;, BloombergLP::bslalg::SynthThreeWayUtil::Result&lt;T2&gt;&gt;
xref:bsl/operator_3way-05.adoc[operator&lt;&equals;&gt;](
    xref:bsl/pair-0b.adoc[pair&lt;T1, T2&gt;] const& lhs,
    xref:bsl/pair-0b.adoc[pair&lt;T1, T2&gt;] const& rhs);
----

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

Perform a lexicographic three&hyphen;way comparison of `lhs` and `rhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class KEY,
    class COMPARATOR,
    class ALLOCATOR&gt;
xref:BloombergLP/bslalg/SynthThreeWayUtil/Result.adoc[BloombergLP::bslalg::SynthThreeWayUtil::Result&lt;KEY&gt;]
xref:bsl/operator_3way-0da.adoc[operator&lt;&equals;&gt;](
    xref:bsl/set-0d.adoc[set&lt;KEY, COMPARATOR, ALLOCATOR&gt;] const& lhs,
    xref:bsl/set-0d.adoc[set&lt;KEY, COMPARATOR, ALLOCATOR&gt;] const& rhs);
----

[.small]#xref:bsl/operator_3way-0da.adoc[_» more&period;&period;&period;_]#

Perform a lexicographic three&hyphen;way comparison of `lhs` and `rhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class KEY,
    class VALUE,
    class COMPARATOR,
    class ALLOCATOR&gt;
xref:BloombergLP/bslalg/SynthThreeWayUtil/Result.adoc[BloombergLP::bslalg::SynthThreeWayUtil::Result&lt;bsl::pair&lt;KEY const, VALUE&gt;&gt;]
xref:bsl/operator_3way-081.adoc[operator&lt;&equals;&gt;](
    xref:bsl/multimap-0ae.adoc[multimap&lt;KEY, VALUE, COMPARATOR, ALLOCATOR&gt;] const& lhs,
    xref:bsl/multimap-0ae.adoc[multimap&lt;KEY, VALUE, COMPARATOR, ALLOCATOR&gt;] const& rhs);
----

[.small]#xref:bsl/operator_3way-081.adoc[_» more&period;&period;&period;_]#

Perform a lexicographic three&hyphen;way comparison of `lhs` and `rhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class KEY,
    class VALUE,
    class COMPARATOR,
    class ALLOCATOR&gt;
xref:BloombergLP/bslalg/SynthThreeWayUtil/Result.adoc[BloombergLP::bslalg::SynthThreeWayUtil::Result&lt;bsl::pair&lt;KEY const, VALUE&gt;&gt;]
xref:bsl/operator_3way-044.adoc[operator&lt;&equals;&gt;](
    xref:bsl/map-0a7.adoc[map&lt;KEY, VALUE, COMPARATOR, ALLOCATOR&gt;] const& lhs,
    xref:bsl/map-0a7.adoc[map&lt;KEY, VALUE, COMPARATOR, ALLOCATOR&gt;] const& rhs);
----

[.small]#xref:bsl/operator_3way-044.adoc[_» more&period;&period;&period;_]#

Perform a three&hyphen;way comparison of the specified `ptr` and null pointer by using the comparison operators of `TYPE &ast;`&semi; return the result of that comparison&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
std::strong&lowbar;ordering
xref:bsl/operator_3way-0412.adoc[operator&lt;&equals;&gt;](
    xref:bsl/shared_ptr-0a.adoc[shared&lowbar;ptr&lt;TYPE&gt;] const& ptr,
    xref:bsl/nullptr_t-08.adoc[nullptr&lowbar;t] nullPointerLiteral) noexcept;
----

[.small]#xref:bsl/operator_3way-0412.adoc[_» more&period;&period;&period;_]#

Compare `lhs` and `rhs` three&hyphen;way by their stored pointers&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class LHS&lowbar;TYPE,
    class RHS&lowbar;TYPE&gt;
std::strong&lowbar;ordering
xref:bsl/operator_3way-086.adoc[operator&lt;&equals;&gt;](
    xref:bsl/shared_ptr-0a.adoc[shared&lowbar;ptr&lt;LHS&lowbar;TYPE&gt;] const& lhs,
    xref:bsl/shared_ptr-0a.adoc[shared&lowbar;ptr&lt;RHS&lowbar;TYPE&gt;] const& rhs) noexcept;
----

[.small]#xref:bsl/operator_3way-086.adoc[_» more&period;&period;&period;_]#

Perform a lexicographic three&hyphen;way comparison of two strings&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOC1,
    class ALLOC2&gt;
xref:bsl/String_ComparisonCategoryType.adoc[bsl::String&lowbar;ComparisonCategoryType&lt;CHAR&lowbar;TRAITS&gt;]
xref:bsl/operator_3way-07c1.adoc[operator&lt;&equals;&gt;](
    xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC1&gt;] const& lhs,
    std::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC2&gt; const& rhs) noexcept;
----

[.small]#xref:bsl/operator_3way-07c1.adoc[_» more&period;&period;&period;_]#

Perform a lexicographic three&hyphen;way comparison of two strings&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOC&gt;
xref:bsl/String_ComparisonCategoryType.adoc[bsl::String&lowbar;ComparisonCategoryType&lt;CHAR&lowbar;TRAITS&gt;]
xref:bsl/operator_3way-0d7.adoc[operator&lt;&equals;&gt;](
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC&gt;] const& lhs,
    CHAR&lowbar;TYPE const* rhs);
----

[.small]#xref:bsl/operator_3way-0d7.adoc[_» more&period;&period;&period;_]#

Perform a lexicographic three&hyphen;way comparison of two strings&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOC&gt;
xref:bsl/String_ComparisonCategoryType.adoc[bsl::String&lowbar;ComparisonCategoryType&lt;CHAR&lowbar;TRAITS&gt;]
xref:bsl/operator_3way-041c.adoc[operator&lt;&equals;&gt;](
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC&gt;] const& lhs,
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC&gt;] const& rhs) noexcept;
----

[.small]#xref:bsl/operator_3way-041c.adoc[_» more&period;&period;&period;_]#

Perform a three&hyphen;way comparison of the specified `lhs` and `rhs` vectors and return the result of that comparison&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslalg/SynthThreeWayUtil/Result.adoc[BloombergLP::bslalg::SynthThreeWayUtil::Result&lt;Impl&gt;]
xref:bsl/operator_3way-037.adoc[operator&lt;&equals;&gt;](
    xref:bsl/vector-086.adoc[vector] const& lhs,
    xref:bsl/vector-086.adoc[vector] const& rhs);
----

[.small]#xref:bsl/operator_3way-037.adoc[_» more&period;&period;&period;_]#

Perform a three&hyphen;way comparison of the operands&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class VALUE&lowbar;TYPE,
    class ALLOCATOR&gt;
xref:BloombergLP/bslalg/SynthThreeWayUtil/Result.adoc[BloombergLP::bslalg::SynthThreeWayUtil::Result&lt;VALUE&lowbar;TYPE&gt;]
xref:bsl/operator_3way-01c.adoc[operator&lt;&equals;&gt;](
    xref:bsl/vector-00d.adoc[vector&lt;VALUE&lowbar;TYPE, ALLOCATOR&gt;] const& lhs,
    xref:bsl/vector-00d.adoc[vector&lt;VALUE&lowbar;TYPE, ALLOCATOR&gt;] const& rhs);
----

[.small]#xref:bsl/operator_3way-01c.adoc[_» more&period;&period;&period;_]#

== Return Value

* three&hyphen;way comparison result of the two multisets
* result of the three&hyphen;way comparison
* three&hyphen;way comparison result of the queues
* the three&hyphen;way comparison result of `lhs` and `rhs`
* result of the lexicographic three&hyphen;way comparison
* three&hyphen;way comparison result of `ptr` and a null pointer
* three&hyphen;way comparison result of the stored pointers
* ordering result of the lexicographic three&hyphen;way comparison

== Parameters

[cols="1,4"]
|===
| Name| Description
| *lhs*
| left&hyphen;hand multiset to compare
| *rhs*
| right&hyphen;hand multiset to compare
| *value*
| value compared with or used to initialize the optional
| *nullopt*
| disengaged&hyphen;optional tag&semi; value is unused
| *ptr*
| pointer to the object to manage or refer to
| *nullPointerLiteral*
| null&hyphen;pointer literal (unused&semi; selects this overload)
|===


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