mrdocs::operator<=>
Three‐way comparison operators
Synopses
Declared in <mrdocs/Metadata/Name/NameBase.hpp>
Three‐way comparison operator
constexpr
auto
operator<=>(
ArrayView a,
ArrayView b) noexcept
requires requires (const T& x, const T& y) { x <=> y; };
Performs a three‐way comparison between two Optional values. If both are engaged, compares their contained values; otherwise, compares engagement state.
template<
typename T,
std::three_way_comparable_with<T> U>
[[nodiscard]]
constexpr
std::compare_three_way_result_t<T, U>
operator<=>(
Optional<T> const& x,
Optional<U> const& y);
Performs a three‐way comparison between an Optional and std::nullopt. Returns std::strong_ordering::greater if engaged, std::strong_ordering::equal if disengaged.
template<typename T>
[[nodiscard]]
constexpr
std::strong_ordering
operator<=>(
Optional<T> const& x,
std::nullopt_t rhs) noexcept;
Performs a three‐way comparison between an Optional and a value. If the Optional is engaged, compares its value to v; otherwise, returns less.
template<
typename T,
typename U>
requires (!detail::isDerivedFromOptional<U>)
&& requires { typename std::compare_three_way_result_t<T, U>; }
&& std::three_way_comparable_with<T, U>
constexpr
std::compare_three_way_result_t<T, U>
operator<=>(
Optional<T> const& x,
U const& v);
Three‐way comparison of two polymorphic objects.
template<class Base>
requires detail::CanVisitCompare<Base>
auto
operator<=>(
Polymorphic<Base> const& lhs,
Polymorphic<Base> const& rhs);
Three‐way comparison for any described type.
template<typename T>
requires DescribedComparable<T>
std::strong_ordering
operator<=>(
T const& a,
T const& b);
Compare two polymorphic names by visitor dispatch.
std::strong_ordering
operator<=>(
Polymorphic<Name> const& lhs,
Polymorphic<Name> const& rhs);
Compare two polymorphic types by visitor dispatch.
std::strong_ordering
operator<=>(
Polymorphic<Type> const& lhs,
Polymorphic<Type> const& rhs);
Compare polymorphic template arguments.
std::strong_ordering
operator<=>(
Polymorphic<TArg> const& lhs,
Polymorphic<TArg> const& rhs);
Compare polymorphic template parameters.
std::strong_ordering
operator<=>(
Polymorphic<TParam> const& lhs,
Polymorphic<TParam> const& rhs);
Return Value
-
The result of the three‐way comparison between the optionals or their values.
-
The result of the three‐way comparison with
std::nullopt. -
The result of the three‐way comparison with the value.
-
strong_ordering comparing held objects.
Created with MrDocs