# std::relation

> C++ Atlas: `cppatlas.com/w/cpp/concepts/relation` | Source: https://en.cppreference.com/w/cpp/concepts/relation | Domain: Concepts | Standards: C++20

The concept relation<R, T, U> specifies that R defines a binary relation over the set of expressions whose type and value category are those encoded by either T or U.

## Official Specification Summary (cppreference)

```cpp
// Defined in header <concepts>

template< class R, class T, class U >
concept relation =
    std::predicate<R, T, T> && std::predicate<R, U, U> &&
    std::predicate<R, T, U> && std::predicate<R, U, T>; // (1) (since C++20)
```

The concept `relation<R, T, U>` specifies that `R` defines a binary relation over the set of expressions whose type and value category are those encoded by either `T` or `U`.

### References

- C++23 standard (ISO/IEC 14882:2024):

  - 18.7.5 Concept `relation` [concept.relation]

- C++20 standard (ISO/IEC 14882:2020):

  - 18.7.5 Concept `relation` [concept.relation]

---
Attribution: content from https://en.cppreference.com/w/cpp/concepts/relation (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.