std::equal_...,less_equal,(3)
π std::equal_to, not_equal_to, less, greater, less_equal, greater_equal π
okay so bestie, welcome to the C++ Standard Libary (3) manual page β page tag std::equal_...,less_equal,(3), manual name folded in right here, and we are not doing a boring copy-paste header line. This page is about the standard comparison function objects being partially specialized for std::experimental::propagate_const<T>. It's niche! It's specific! It's giving library-fundamentals-TS-v2 realness, and honestly? iconic. π¦β¨
πΈ NAME πΈ
The NAME line is literally this, truncated energy and all:
std::equal_to,not_equal_to,less,greater,less_equal, -
std::equal_to,not_equal_to,less,greater,less_equal,
no cap, we're keeping it exactly like that. π
β¨ Synopsis β¨
Defined in header <experimental/propagate_const>.
template< class T > struct equal_to<std::experimental::propagate_const<T>>;
template< class T > struct not_equal_to<std::experimental::propagate_const<T>>;
template< class T > struct less<std::experimental::propagate_const<T>>;
template< class T > struct greater<std::experimental::propagate_const<T>>;
template< class T > struct less_equal<std::experimental::propagate_const<T>>;
template< class T > struct greater_equal<std::experimental::propagate_const<T>>;
Each one of those is tagged (library fundamentals TS v2) in the original. periodt. π
The standard comparison function objects are partially specialized for std::experimental::propagate_const<T>.
Let p.t_ denote the pointer-like object wrapped by a std::experimental::propagate_const<T> p, then given objects p and q of type std::experimental::propagate_const<T>, the following shall hold:
std::equal_to<std::experimental::propagate_const<T>>()(p, q) == std::equal_to<T>()(p.t_, q.t_)std::not_equal_to<std::experimental::propagate_const<T>>()(p, q) == std::not_equal_to<T>()(p.t_, q.t_)std::less<std::experimental::propagate_const<T>>()(p, q) == std::less<T>()(p.t_, q.t_)std::greater<std::experimental::propagate_const<T>>()(p, q) == std::greater<T>()(p.t_, q.t_)std::less_equal<std::experimental::propagate_const<T>>()(p, q) == std::less_equal<T>()(p.t_, q.t_)std::greater_equal<std::experimental::propagate_const<T>>()(p, q) == std::greater_equal<T>()(p.t_, q.t_)
These are the exact requirements, bestie. The vibes are mathematical. π«Ά
π Notes π
Lowkey the whole point: these specializations ensure that when T is a pointer type, specializations of these class templates for std::experimental::propagate_const<T> yield a total order, even if the corresponding built-in operators do not. Slay for total order, periodt. π₯
π Example π
This section is incomplete Reason: no example
not me showing up with zero example β that's literally what the page says, so we're not inventing one. π
π¦ See also π¦
equal_toβ function object implementingx == y(class template)not_equal_toβ function object implementingx != y(class template)lessβ function object implementingx < y(class template)greaterβ function object implementingx > y(class template)less_equalβ function object implementingx <= y(class template)greater_equalβ function object implementingx >= y(class template)
π Category: π
- Todo no example
mwah π β source/version: http://cppreference.com; date: 2024.06.10; page tag: std::equal_...,less_equal,(3). byeee bestie π«Άπ
π¦ 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