Namensräume
Varianten
Aktionen

std::get(std::pair)

Aus cppreference.com
< cpp‎ | utility‎ | pair

 
 
 
std::pair
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.
pair::pair
pair::operator=
pair::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.
make_pair
operator=
operator!=
operator<
operator<=
operator>
operator>=
std::swap
get(C++11)
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(C++11)
tuple_element(C++11)
 
template< size_t N, class T1, class T2 >

typename std::tuple_element<I, std::pair<T1,T2> >::type&

    get( pair<T1, T2>& p );
(1) (seit C++11)
template< size_t N, class T1, class T2 >

const typename std::tuple_element<I, std::pair<T1,T2> >::type&

    get( const pair<T1,T2>& p );
(2) (seit C++11)
template< size_t N, class T1, class T2 >

typename std::tuple_element<I, std::pair<T1,T2> >::type&&

    get( std::pair<T1,T2>&& p );
(3) (seit C++11)
Extrahiert ein Element aus dem Paar mit Tupel-ähnliche Schnittstelle .
Original:
Extracts a element from the pair using tuple-like interface.
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

p -
Paar deren Inhalt zu extrahieren
Original:
pair 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-2)
Versandkosten p.first wenn N==0 und p.second wenn N==1 .
Original:
Returns p.first if N==0 and p.second if N==1.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
Versandkosten std::forward<T1&&>(p.first) wenn N==0 und std::forward<T2&&>(p.second) wenn N==1
Original:
Returns std::forward<T1&&>(p.first) if N==0 and std::forward<T2&&>(p.second) if N==1
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Ausnahmen

1-3)
noexcept specification:  
noexcept
  (seit C++11)

[Bearbeiten] Beispiel

#include <iostream>
#include <utility>
 
int main()
{
    auto p = std::make_pair(1, 3.14);
    std::cout << '(' << std::get<0>(p) << ", " << std::get<1>(p) << ')' << std::endl;
}

Output:

(1, 3.14)


[Bearbeiten] Siehe auch

Tupel zugreift angegebene Element
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]
accesses an element of an array
(Funktions-Template) [edit]