<metanoindex/>
Abfragen der Anzahl von Elementen in einer Parameter Pack .
Original:
Queries the number of elements in a Parameter Pack.
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.
Syntax
sizeof...( parameter_pack )
|
(seit C++11) | ||||||||
Gibt ein Objekt vom Typ 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.
Erklärung
Gibt die Anzahl der Elemente in einem Parameter Pack .
Original:
Returns the number of elements in a Parameter Pack.
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.
Keywords
Beispiel
#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