September 2017
Intermediate to advanced
822 pages
26h 51m
English
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.
Template parameters can be defined to accept an unbounded number of template arguments. Templates with this ability are called variadic templates.
For example, you can use the following code to call print() for a variable number of ...
Read now
Unlock full access