[#mrdocs-operator_3way-081] = xref:mrdocs.adoc[mrdocs]::operator<=> :relfileprefix: ../ :mrdocs: Performs a three‐way comparison between two Optional values. If both are engaged, compares their contained values; otherwise, compares engagement state. == Synopsis Declared in `<mrdocs/ADT/Optional.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename T, std::three_way_comparable_with<T> U> [[nodiscard]] constexpr std::compare_three_way_result_t<T, U> operator<=>( xref:mrdocs/Optional-03.adoc[Optional<T>] const& x, xref:mrdocs/Optional-03.adoc[Optional<U>] const& y); ---- == Return Value The result of the three‐way comparison between the optionals or their values. [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]#