C++的新特性 存在于C++ 0X 和C++11中
简要摘抄一下C++ Variadic template的特性:
Variadic template is a template, which can take an arbitrary number of template arguments of any type. Both the classes & functions can be variadic. Here's a variadic class template:
| |
Any of the following ways to create an instance of this class template is valid:
| |
The number of variadic template arguments can also be zero, so the following
VariadicTemplate<> instance;
is also valid C++11.
However, if you create a template like this:
| |
You must set at least one type as a template argument ( for typename T ), unless default type has been initilialized, like in the following declaration:
| |