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

Three&hyphen;way comparison operators

== Synopses

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

Three&hyphen;way comparison operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
std::strong&lowbar;ordering
xref:beman/optional/operator_3way-0a.adoc[operator&lt;&equals;&gt;](
    xref:beman/optional/nullopt_t.adoc[nullopt&lowbar;t] lhs,
    xref:beman/optional/nullopt_t.adoc[nullopt&lowbar;t] rhs) noexcept;
----

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

Three&hyphen;way comparison operator


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

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

Three&hyphen;way comparison operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
constexpr
std::strong&lowbar;ordering
xref:beman/optional/operator_3way-05.adoc[operator&lt;&equals;&gt;](
    xref:beman/optional/optional-03.adoc[optional&lt;T&gt;] const& x,
    xref:beman/optional/nullopt_t.adoc[nullopt&lowbar;t] rhs) noexcept;
----

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

Three&hyphen;way comparison operator


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    typename U&gt;
requires (!is&lowbar;derived&lowbar;from&lowbar;optional&lt;U&gt;) &amp;&amp; std&colon;&colon;three&lowbar;way&lowbar;comparable&lowbar;with&lt;T, U&gt;
constexpr
std::compare&lowbar;three&lowbar;way&lowbar;result&lowbar;t&lt;T, U&gt;
xref:beman/optional/operator_3way-08.adoc[operator&lt;&equals;&gt;](
    xref:beman/optional/optional-03.adoc[optional&lt;T&gt;] const& x,
    U const& v);
----

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


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