std::piecewise_construct
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
<tbody> </tbody> constexpr piecewise_construct_t piecewise_construct = std::piecewise_construct_t(); |
(dal C++11) | |
Il std::piecewise_construct costante è un'istanza di un tipo di tag vuoto struct std::piecewise_construct_t.
Original:
The constant std::piecewise_construct is an instance of an empty struct tag type std::piecewise_construct_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.
Esempio
#include <iostream>
#include <utility>
#include <tuple>
struct Foo {
Foo(std::tuple<int, float>)
{
std::cout << "Constructed a Foo from a tuple\n";
}
Foo(int, float)
{
std::cout << "Constructed a Foo from an int and a float\n";
}
};
int main()
{
std::tuple<int, float> t(1, 3.14);
std::pair<Foo, Foo> p1(t, t);
std::pair<Foo, Foo> p2(std::piecewise_construct, t, t);
}
Output:
Constructed a Foo from a tuple
Constructed a Foo from a tuple
Constructed a Foo from an int and a float
Constructed a Foo from an int and a float
Vedi anche
(C++11) |
tipo di tag utilizzato per selezionare la funzione di sovraccarico corretta per la costruzione a tratti Original: tag type used to select correct function overload for piecewise construction The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |