std::weak_order(3)
πΈ NAME πΈ
okay so bestie, you're in the C++ Standard Libary manual β yes, that spelling is in the header, not my fault π
β and this is the page for std::weak_order(3). The NAME line is literally std::weak_order - std::weak_order. Self-titled icon behavior, no cap. π
β¨ Synopsis β¨
Defined in header <compare>.
inline namespace /* unspecified */ {
inline constexpr /* unspecified */ weak_order = /* unspecified (since C++20) */;
}
π Call signature π
template< class T, class U >
requires /* see below */
constexpr std::weak_ordering weak_order(T&& t, U&& u) noexcept(/* see below */);
It compares two values using 3-way comparison and produces a result of type std::weak_ordering. slay. π
Let t and u be expressions and T and U denote decltype((t)) and decltype((u)) respectively, std::weak_order(t, u) is expression-equivalent to:
- If
std::is_same_v<std::decay_t<T>, std::decay_t<U>>is true:std::weak_ordering(weak_order(t, u)), if it is a well-formed expression with overload resolution performed in a context that does not include a declaration ofstd::weak_order,- otherwise, if
Tis a floating-point type:- if
std::numeric_limits<T>::is_iec559is true, performs the weak ordering comparison of floating-point values (see below) and returns that result as a value of typestd::weak_ordering, - otherwise, yields a value of type
std::weak_orderingthat is consistent with the ordering observed byT's comparison operators,
- if
- otherwise,
std::weak_ordering(std::compare_three_way()(t, u)), if it is well-formed, - otherwise,
std::weak_ordering(std::strong_order(t, u)), if it is well-formed.
- In all other cases, the expression is ill-formed, which can result in substitution failure when it appears in the immediate context of a template instantiation.
π Example π
This section is incomplete.
Reason: no example.
the lore is literally still loading π
π¦ See also π¦
weak_ordering(C++20)β the result type of 3-way comparison that supports all 6 operators and is not substitutable (class).strong_order(C++20)β performs 3-way comparison and produces a result of typestd::strong_ordering(customization point object).partial_order(C++20)β performs 3-way comparison and produces a result of typestd::partial_ordering(customization point object).compare_weak_order_fallback(C++20)β performs 3-way comparison and produces a result of typestd::weak_ordering, even ifoperator<=>is unavailable (customization point object).
π Category π
- Todo no example
kisses bestie, this page came from http://cppreference.com, dated 2024.06.10, and it's your girl std::weak_order(3) signing off πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms