17 Concepts library [concepts]

17.4 Language-related concepts [concepts.lang]

17.4.5 Concept CommonReference [concept.commonref]

For two types T and U, if common_­reference_­t<T, U> is well-formed and denotes a type C such that both ConvertibleTo<T, C> and ConvertibleTo<U, C> are satisfied, then T and U share a common reference type, C.
[Note
:
C could be the same as T, or U, or it could be a different type.
C may be a reference type.
end note
]
template<class T, class U> concept CommonReference = Same<common_reference_t<T, U>, common_reference_t<U, T>> && ConvertibleTo<T, common_reference_t<T, U>> && ConvertibleTo<U, common_reference_t<T, U>>;
Let C be common_­reference_­t<T, U>.
Let t be a function whose return type is T, and let u be a function whose return type is U.
CommonReference<T, U> is satisfied only if:
  • C(t()) equals C(t()) if and only if t() is an equality-preserving expression ([concepts.equality]).
  • C(u()) equals C(u()) if and only if u() is an equality-preserving expression.
[Note
:
Users can customize the behavior of CommonReference by specializing the basic_­common_­reference class template ([meta.trans.other]).
end note
]