std::get(std::tuple)
提供:cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| template< std::size_t I, class... Types > typename std::tuple_element<I, tuple<Types...> >::type& |
(1) | (C + + 11以来) |
| template< std::size_t I, class... Types > typename std::tuple_element<I, tuple<Types...> >::type&& |
(2) | (C + + 11以来) |
| template< std::size_t I, class... Types > typename std::tuple_element<I, tuple<Types...> >::type const& |
(3) | (C + + 11以来) |
タプルから
Ith要素の要素を抽出します。 I[0, sizeof...(Types))の整数値です.Original:
Extracts the
Ith element element from the tuple. I is an integer value in [0, sizeof...(Types)).The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目次 |
[編集] パラメータ
| t | - | その内容を抽出するタプル
Original: tuple whose contents to extract The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[編集] 値を返します
1)Ithのt要素への参照.Original:
Reference to the
Ith element of t.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
右辺値は
3) Ithのt要素への参照、要素は左辺値参照が返された場合で、左辺値参照型でない限り.Original:
Rvalue reference to the
Ith element of t, unless the element is of lvalue reference type, in which case lvalue reference is returned.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Ithのt要素へのconst参照.Original:
Const reference to the
Ith element of t.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] 例外
[編集] 例
#include <iostream> #include <string> #include <tuple> int main() { auto t = std::make_tuple(1, "Foo", 3.14); std::cout << "(" << std::get<0>(t) << ", " << std::get<1>(t) << ", " << std::get<2>(t) << ")\n"; }
Output:
(1, Foo, 3.14)
[編集] も参照してください
accesses an element of an array (関数テンプレート) | |
| (C++11) |
pairの要素にアクセスします Original: accesses an element of a pair The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数テンプレート) |