synth-three-way, synth-three-way-result

  1. A function object whose operator() behaves as the synthesized three-way comparison function. Equivalent to: constexpr auto synth-three-way = []<class T, class U>(const T& t, const U& u) requires requires { { t < u } -> boolean-testable; { u < t } -> boolean-testable; } { if constexpr (std::three_way_comparable_with<T, U>) return t <=> u; else { if (t < u) return std::weak_ordering::less; if (u < t) return std::weak_ordering::greater; return std::weak_ordering::equivalent; } };

# Declarations

constexpr auto synth-three-way = /* see below */;

(since C++20) (exposition only*)

template< class T, class U = T >
using synth-three-way-result =
decltype(synth-three-way(std::declval<T&>(), std::declval<U&>()));

(since C++20) (exposition only*)

# Parameters

# Return value

The compare result.

# See also