std::equivalence_relation(3)

πŸ“¦
version 2024.07.05 Β· 3 versions
, in nixpkgs unstable, opensuse-leap 16.0

🌟 std::equivalence_relation(3) 🌟

okay bestie, welcome to the std::equivalence_relation page from the C++ Standard Libary manual β€” yes, that’s the manual name and we’re keeping it exactly πŸ’…


πŸ’– NAME πŸ’–

std::equivalence_relation β€” std::equivalence_relation

yes, the name is the name, no cap 😭 iconic behavior honestly πŸŽ€


πŸ¦‹ Synopsis πŸ¦‹

Defined in header <concepts>
template< class R, class T, class U >                   (since C++20)
concept equivalence_relation = std::relation<R, T, U>;

The concept equivalence_relation<R, T, U> specifies that the relation R imposes an equivalence relation on its arguments. periodt πŸ’«

🧠 Semantic requirements 🧠

A relation r is an equivalence relation if:

  • it is reflexive: for all x, r(x, x) is true;
  • it is symmetric: for all a and b, r(a, b) is true if and only if r(b, a) is true;
  • it is transitive: r(a, b) && r(b, c) implies r(a, c).

like yes, those three little rules are doing the whole job and they ate πŸ”₯


πŸŽ€ Notes πŸŽ€

The distinction between relation and equivalence_relation is purely semantic.

that’s the note, bestie β€” purely semantic, no extra drama in the wording 🫢✨


source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::equivalence_relation(3) β€” bye bestie, go be semantically slay πŸ’–βœ¨

πŸ“¦ where this page comes from