Namensräume
Varianten
Aktionen

std::get(std::array)

Aus cppreference.com
< cpp‎ | container‎ | array

 
 
 
std::array
Member-Funktionen
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.
Elementzugriff zerstört
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
Iteratoren
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
Kapazität
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
Modifiers
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
Non-Member-Funktionen
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
Helper-Klassen
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) (seit C++11)
template<size_t I, class T, size_t N >
T&& get( array<T,N>&& a );
(2) (seit C++11)
template<size_t I, class T, size_t N >
const T& get( const array<T,N>& a );
(3) (seit C++11)
Extrahiert die Ith element aus dem Array .
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 muss ein Integer-Wert im Bereich [0, N) sein. Dies wird bei der Kompilierung durchgesetzt zu at() entgegengesetzt oder 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.

Inhaltsverzeichnis

[Bearbeiten] Parameter

a -
Array, dessen Inhalt zu extrahieren
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.

[Bearbeiten] Rückgabewert

1)
Verweis auf die Ith Element a .
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)
Rvalue Verweis auf das Element Ith a, sofern das Element der L-Wert-Referenz-Typ, wobei in diesem Fall L-Wert Verweis zurückgegeben .
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)
Const Verweis auf die Ith Element a .
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.

[Bearbeiten] Ausnahmen

noexcept specification:  
noexcept
  (seit C++11)

[Bearbeiten] Beispiel

#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)

[Bearbeiten] Siehe auch

Zugriff auf angegebene Element
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.

(öffentliche Elementfunktion) [edit]
Zugriff auf angegebene Element mit Überprüfung von Grenzen
Original:
access specified element with bounds checking
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(öffentliche Elementfunktion) [edit]
Zugriff auf das angegebene Element des Tupels
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.

(Funktions-Template) [edit]
greift ein Element eines 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.

(Funktions-Template) [edit]