std::strict_weak_order(3)
π NAME π
okay so welcome to std::strict_weak_order(3), the C++ Standard Libary page that's about to make strict weak ordering make sense, bestie. The name is literally std::strict_weak_order β std::strict_weak_order. iconic, no notes. π
β¨ Synopsis β¨
Defined in header <concepts>:
template< class R, class T, class U > (since C++20)
concept strict_weak_order = std::relation<R, T, U>;
The concept strict_weak_order<R, T, U> specifies that the relation R imposes a strict weak ordering on its arguments. that's the whole vibe check. π¦
π§ Semantic requirements π§
A relation r is a strict weak ordering if:
- it is irreflexive: for all
x,r(x, x)isfalse; - it is transitive: for all
a,bandc, ifr(a, b)andr(b, c)are both true thenr(a, c)is true; - let
e(a, b)be!r(a, b) && !r(b, a), theneis transitive:e(a, b) && e(b, c)impliese(a, c).
Under these conditions, it can be shown that e is an equivalence relation, and r induces a strict total ordering on the equivalence classes determined by e. like wow, math ate. πβ¨
π Notes π
The distinction between relation and strict_weak_order is purely semantic. lowkey important, highkey just semantics. π«Ά
π See also π
LessThanComparable
mwah π β source: cppreference.com, version/date 2024.06.10, page std::strict_weak_order(3). bye bestie, go slay your comparators πΈπ
π¦ 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