sizeof... operator
提供: cppreference.com
![]() |
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
クエリパラメーターパック内の要素の数.
Original:
Queries the number of elements in a パラメーターパック.
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.
目次 |
[編集] 構文
sizeof...( parameter_pack )
|
(C++11およびそれ以降) | ||||||||
タイプ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.
[編集] 説明
パラメーターパック内の要素数を返します。.
Original:
Returns the number of elements in a パラメーターパック.
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.
[編集] キーワード
[編集] 例
このコードを実行します
#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'; }
出力:
0 1 3