Generic functions and classes typically accept a fixed number of type arguments. However, generic functions and classes that accept a variable number of type arguments have proven to be a very useful, even though there is no support for this feature in C++. Numerous foundational libraries rely on clever template and preprocessor tricks to emulate such variable-length templates. By several measures these emulations are inadequate. This paper describes variadic templates, an extension to the C++ language that significantly improves existing implementations of widely used C++ libraries in terms of code size, quality of error diagnostics, compilation speed, and generality. Furthermore, variadic templates enable new applications, such as type-safe implementations of functions like printf, and improved support for generic mixin classes. Variadic templates are part of the upcoming ISO C++ Standard, dubbed C++0x, and we have integrated variadic templates into the GNU C++ compiler. © JOT, 2002.
CITATION STYLE
Gregor, D., & Järvi, J. (2008). Variadic templates for C++0x. Journal of Object Technology, 7(2), 31–51. https://doi.org/10.5381/jot.2008.7.2.a2
Mendeley helps you to discover research relevant for your work.