Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      tuple-like,pair-like

      From cppreference.com
      <cpp‎ |utility‎ |tuple
       
       
      Utilities library
       
       
      template<class T>
      concept tuple-like=/* see below */;
      (1)(since C++23)
      (exposition only*)
      template<class T>

      concept pair-like=

          tuple-like<T>&&std::tuple_size_v<std::remove_cvref_t<T>>==2;
      (2)(since C++23)
      (exposition only*)
      1) A typeT models and satisfies the concepttuple-like ifstd::remove_cvref_t<T> is a specialization of
      (since C++26)
      2)pair-like objects aretuple-like objects with exactly 2 elements.

      [edit]Notes

      tuple-like types implement thetuple protocol, i.e., such types can be used withstd::get,std::tuple_element andstd::tuple_size.

      Elements oftuple-like types can be bound withstructured binding.

      [edit]See also

      tuple-like andpair-like are used in the following standard library components:

      constructs a newtuple
      (public member function)[edit]
      assigns the contents of onetuple to another
      (public member function)[edit]
      (removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(C++20)
      lexicographically compares the values in the tuple
      (function template)[edit]
      determines the common reference type of atuple and atuple-like type
      (class template specialization)[edit]
      determines the common type of atuple and atuple-like type
      (class template specialization)[edit]
      (C++11)
      creates atuple by concatenating any number of tuples
      (function template)[edit]
      (C++17)
      calls a function with a tuple of arguments
      (function template)[edit]
      construct an object with a tuple of arguments
      (function template)[edit]
      constructs newpair
      (public member function ofstd::pair<T1,T2>)[edit]
      assigns the contents
      (public member function ofstd::pair<T1,T2>)[edit]
      converts thesubrange to apair-like type
      (public member function ofstd::ranges::subrange<I,S,K>)[edit]
      takes aview consisting oftuple-like values and a number N and produces aview of Nth element of each tuple
      (class template)(range adaptor object)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/utility/tuple/tuple-like&oldid=172741"

      [8]ページ先頭

      ©2009-2025 Movatter.jp