std::is_eq,...td::is_gteq(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

okay bestie, welcome to the std::is_eq,...td::is_gteq(3) page from the C++ Standard Libary manual πŸ’…βœ¨ this is the whole squad of tiny constexpr bool helpers that turn a 3-way comparison result into relational-operator energy. no cap, every detail is staying.

🌸 NAME 🌸

  • std::is_eq,std::is_neq,std::is_lt,std::is_gt,std::is_lteq,std::is_gteq β€” literally this whole friend group: std::is_eq,std::is_neq,std::is_lt,std::is_gt,std::is_lteq,std::is_gteq.

✨ Synopsis ✨

Defined in header <compare>

constexpr bool is_eq( std::partial_ordering cmp ) noexcept;   (1) (since C++20)
constexpr bool is_neq( std::partial_ordering cmp ) noexcept;  (2) (since C++20)
constexpr bool is_lt( std::partial_ordering cmp ) noexcept;   (3) (since C++20)
constexpr bool is_lteq( std::partial_ordering cmp ) noexcept; (4) (since C++20)
constexpr bool is_gt( std::partial_ordering cmp ) noexcept;   (5) (since C++20)
constexpr bool is_gteq( std::partial_ordering cmp ) noexcept; (6) (since C++20)

These functions take a result of 3-way comparison and convert it to the result of one of the six relational operators. 🫢

Specifically, these functions return:

  1. cmp == 0
  2. cmp != 0
  3. cmp < 0
  4. cmp <= 0
  5. cmp > 0
  6. cmp >= 0

πŸŽ€ Parameters πŸŽ€

  • cmp β€” result of 3-way comparison.

πŸ¦‹ Return value πŸ¦‹

bool β€” result of the corresponding relational operation. periodt.

πŸ’€ Example πŸ’€

This section is incomplete 😭

Reason: no example

πŸ‘‘ See also πŸ‘‘

  • partial_ordering β€” the result type of 3-way comparison that supports all 6 operators, (C++20) is not substitutable, and allows incomparable values (class).

🌈 Category 🌈

  • * Todo no example

mwah πŸ’– source/version and date, bb: http://cppreference.com Β· 2024.06.10. That's the C++ Standard Libary page β€” slay and goodbye βœ¨πŸŽ€

πŸ“¦ where this page comes from