第4章 可变参数模板:4.1 可变参数模板
Chapter 4:Variadic Templates 第4章 可变参数模板 Since C++11, templates can have parameters that accept a variable number of template arguments. This feature allows the use of templates in places where you have to pass an arbitrary number of arguments of arbitrary types. A typical application is to pass an arbitrary number of parameters of arbitrary type through a class or framework. Another application is to provide generic code to process any number of parameters of any type. 从C++11开始,模板可以接受数量可变的模板参数。该特性允许我们在需要传入任意数量、任意类型参数的地方使用模板。经典的应用就是通过类或框架传递任意数量和任意类型的参数。另一个应用是提供泛型代码来处理任意数量和任意类型的参数。 4.1 Variadic