Espaços nominais
Variantes
Acções

std::make_tuple

Da cppreference.com
< cpp‎ | utility‎ | tuple

 
 
Biblioteca de utilitários
Digite apoio (basic types, RTTI, type traits)
Gerenciamento de memória dinâmica
De tratamento de erros
Utilidades do programa
Variadic funções
Data e hora
Objetos de função
(C++11)
Os operadores relacionais
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Pares e tuplas
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
Troque, avançar e avançar
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
(C++11)
 
std::tuple
Funções de membro
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.
tuple::tuple
tuple::operator=
tuple::swap
Não-membros funções
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_tuple
Classes auxiliares
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.
 
Definido no cabeçalho <tuple>
template<class... Types>
tuple<VTypes...> make_tuple( Types&&... args);
(desde C++11)

Creates a tuple object, deducing the target type from the types of arguments. The deduced types are std::decay<Ti>::type (transformed as if passed to a function by value) unless application of std::decay results in std::reference_wrapper<X> for some type X, in which case the deduced type is is X&.

[editar]Parâmetros

args -
zero ou mais argumentos para construir a tupla
Original:
zero or more arguments to construct the tuple from
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar]Valor de retorno

A std::tuple object containing the given values.

[editar]Exemplo

#include <iostream>#include <tuple>#include <functional>   int main(){auto t1 = std::make_tuple(10, "Test", 3.14);std::cout<<"The value of t1 is "<<"("<< std::get<0>(t1)<<", "<< std::get<1>(t1)<<", "<< std::get<2>(t1)<<")\n";   int n =1;auto t2 = std::make_tuple(std::ref(n), n); n =7;std::cout<<"The value of t2 is "<<"("<< std::get<0>(t2)<<", "<< std::get<1>(t2)<<")\n";}

Saída:

The value of t1 is (10, Test, 3.14) The value of t2 is (7, 1)
cria um tuple de referências lvalue ou desempacota a tupla em objetos individuais
Original:
creates a tuple of lvalue references or unpacks a tuple into individual objects
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de função)[edit]
cria um tuple de referências rvalue
Original:
creates a tuple of rvalue references
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de função)[edit]
cria um tuple pela concatenação de qualquer número de tuplas
Original:
creates a tuple by concatenating any number of tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de função)[edit]
close