std::equivalence_relation
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Concepts library
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)
(C++20)(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)
(C++20)
(C++20)
equivalence_relation
(C++20)
(C++20)
Exposition-only concepts
(C++20)
Defined in header
<concepts>
template< class R, class T, class U >
concept equivalence_relation = std::relation <R, T, 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.
[edit] 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
andb
,r(a, b)
is true if and only ifr(b, a)
is true; - it is transitive:
r(a, b) && r(b, c)
impliesr(a, c)
.
[edit] Notes
The distinction between relation
and equivalence_relation
is purely semantic.
[edit] References
- C++23 standard (ISO/IEC 14882:2024):
- 18.7.6 Concept
equivalence_relation
[concept.equiv]
- 18.7.6 Concept
- C++20 standard (ISO/IEC 14882:2020):
- 18.7.6 Concept
equivalence_relation
[concept.equiv]
- 18.7.6 Concept