名前空間
変種
操作

std::get(std::array)

提供: cppreference.com
< cpp‎ | container‎ | array

 
 
 
std::array
メンバ関数
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
要素アクセスの循環参照を解除するために使用されている
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::at
array::operator[]
array::front
array::back
array::data
イテレータ
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::begin
array::cbegin
array::end
array::cend
array::rbegin
array::crbegin
array::rend
array::crend
容量
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::empty
array::size
array::max_size
修飾子
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::fill
array::swap
非メンバ関数
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
get
swap
ヘルパークラス
Original:
Helper classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
tuple_size
tuple_element
 
template<size_t I, class T, size_t N >
T& get( array<T,N>& a );
(1) (C + + 11以来)
template<size_t I, class T, size_t N >
T&& get( array<T,N>&& a );
(2) (C + + 11以来)
template<size_t I, class T, size_t N >
const T& get( const array<T,N>& a );
(3) (C + + 11以来)
配列からIth要素要素を抽出.
Original:
Extracts the Ith element element from the array.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Iは範囲[0, N)の整数値でなければなりません。 at()またはoperator[]()とは対照的に、これはコンパイル時に適用されている.
Original:
I must be an integer value in range [0, N). This is enforced at compile time as opposed to at() or operator[]().
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

a -
その内容を抽出するための配列
Original:
array 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)
Itha要素への参照.
Original:
Reference to the Ith element of a.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
右辺値はItha要素への参照、要素は左辺値参照が返された場合で、左辺値参照型でない限り.
Original:
Rvalue reference to the Ith element of a, 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.
3)
Itha要素へのconst参照.
Original:
Const reference to the Ith element of a.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 例外

noexcept specification:  
noexcept
  (C + + 11以来)

[編集]

#include <iostream>
#include <array>
 
int main()
{
    std::array<int, 3> arr;
 
    // set values:
    std::get<0>(arr) = 1;
    std::get<1>(arr) = 2;
    std::get<2>(arr) = 3;
 
    // get values:
    std::cout << "(" << std::get<0>(arr) << ", " << std::get<1>(arr)
              << ", " << std::get<2>(arr) << ")\n";
}

Output:

(1, 2, 3)

[編集] も参照してください

指定された要素にアクセスします
Original:
access specified element
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
指定された要素にアクセスします。境界チェックを行います。
(パブリックメンバ関数) [edit]
タプルは、指定された要素にアクセスします
Original:
tuple accesses specified element
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(関数テンプレート) [edit]
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.

(関数テンプレート) [edit]