sizeof... operator
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. |
Query il numero di elementi in una parametro confezione.
Original:
Queries the number of elements in a parametro confezione.
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.
Indice |
[modifica] Sintassi
sizeof...( parameter_pack )
|
(dal C++11) | ||||||||
Restituisce un oggetto di tipo std::size_t.
Original:
Returns an object of type std::size_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.
[modifica] Spiegazione
Restituisce il numero di elementi in una parametro confezione.
Original:
Returns the number of elements in a parametro confezione.
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.
[modifica] Parole chiave
[modifica] Esempio
#include <iostream> template<class... Args> std::size_t f() { return sizeof...(Args); } int main() { std::cout << f<>() << '\n' << f<int>() << '\n' << f<char, int, double>() << '\n'; }
Output:
0 1 3