std::basic_...on_reference(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

✨ 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 as std::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 list
  • std::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