Learn How To Use C++ Variadic Templates For Windows Development With C++Builder

C++ Builder supports the Variadic templates. Variadic templates are template that take a variable number of arguments. Both the classes and functions can be variadic offered by C++11.

Templates have been a powerful feature in C++. Now, after the introduction of variadic templates, templates have proven themselves even more powerful. Variadic templates are a trustworthy solution to implement delegates and tuples.

Here’s a variadic class template:

Any of the following ways to create an instance of this class template is valid:

Here’s a function template:

The contents of the variadic template arguments are called parameter packs. These packs will then be unpacked inside the function parameters. For example, if you create a function call to the above variadic function template,

an equivalent function template would be like this:

Head over and find out more about C++ variadic templates in the Embarcadero DocWiki!