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

Performs a three&hyphen;way comparison between two Optional values&period; If both are engaged, compares their contained values&semi; otherwise, compares engagement state&period;

== Synopsis

Declared in `&lt;mrdocs&sol;ADT&sol;Optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    std::three&lowbar;way&lowbar;comparable&lowbar;with&lt;T&gt; U&gt;
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
constexpr
std::compare&lowbar;three&lowbar;way&lowbar;result&lowbar;t&lt;T, U&gt;
operator&lt;&equals;&gt;(
    xref:mrdocs/Optional-03.adoc[Optional&lt;T&gt;] const& x,
    xref:mrdocs/Optional-03.adoc[Optional&lt;U&gt;] const& y);
----

== Return Value

The result of the three&hyphen;way comparison between the optionals or their values&period;

[NOTE]
====
The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^].
====
== Parameters

[cols="1,4"]
|===
| Name| Description
| *x*
| The left operand
| *y*
| The right operand
|===


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