std::basic_...on_reference(3)
β¨ std::basic_common_reference β¨
okay so we're in the C++ Standard Libary manual (yes, the source spells it like that β iconic π), and this page is all about std::basic_common_reference π
πΈ NAME πΈ
std::basic_common_reference β that's the whole name, no cap. It's giving niche C++ trait energy and we're obsessed.
π Synopsis π
Defined in header <utility>
template< class T1, class T2, class U1, class U2,
template<class> class TQual, template<class> class UQual >
requires requires { typename
std::pair<std::common_reference_t<TQual<T1>, UQual<U1>>,
(since C++23)
std::common_reference_t<TQual<T2>, UQual<U2>>>; }
struct basic_common_reference<std::pair<T1, T2>, std::pair<U1, U2>,
TQual, UQual>;
okay so the common reference type of two pairs is literally a std::pair made from both common reference types of the corresponding element types of both pairs. The cv and reference qualifiers on the pairs get applied to their element types, periodt.
And this common reference type is defined only if both pairs of corresponding element types have common reference types. no cap, that's the whole vibe check.
𧬠Member types π§¬
typeβ defined asstd::pair<std::common_reference_t<TQual<T1>, UQual<U1>>, std::common_reference_t<TQual<T2>, UQual<U2>>>
π§ͺ Example π§ͺ
This section is incomplete. Reason: no example.
the source really said that, bestie π not me leaving you on read.
π See also π
common_reference(C++20) β determines the common reference type of a group of types (class template)basic_common_reference(C++20) β the class-template name itself, also chilling in the source's SEE ALSO liststd::basic_common_reference<tuple-like>(C++23) β determines the common reference type of a tuple and a tuple-like type (class template specialization)
π·οΈ Category π·οΈ
* Todo no example
okay that's the page! source is http://cppreference.com, version/date is 2024.06.10, and the footer title is std::basic_...on_reference(3) π
β¨π«Ά
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms