ACM Home Page
Please provide us with feedback. Feedback
Variadic templates for C++
Full text PdfPdf (561 KB)
Source Symposium on Applied Computing archive
Proceedings of the 2007 ACM symposium on Applied computing table of contents
Seoul, Korea
SESSION: Object oriented programming languages and systems table of contents
Pages: 1101 - 1108  
Year of Publication: 2007
ISBN:1-59593-480-4
Authors
Douglas Gregor  Indiana University, Bloomington, IN
Jaakko Järvi  Texas A&M University, College Station, TX
Sponsor
SIGAPP: ACM Special Interest Group on Applied Computing
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 14,   Downloads (12 Months): 96,   Citation Count: 4
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1244002.1244243
What is a DOI?

ABSTRACT

Generic functions and classes accepting a variable number of type arguments have proven to be a very useful, but missing, feature of C++. Numerous foundational libraries rely on clever template and preprocessor tricks to emulate such variadic templates. By several measures these emulations are inadequate. This paper describes how C++ can be extended with variadic templates, significantly improving 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. We have implemented variadic templates as an extension of a production quality C++ compiler.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
Peter Dimov. The Boost Bind library. http://www.boost.org/libs/bind/bind.html, August 2001.
 
2
 
3
 
4
Dan Marsden Joel de Guzman. Boost Fusion. http://spirit.sourceforge.net/dl_more/fusion_v2/libs/fusion/doc/html/index.html, 2006.
 
5
Douglas Gregor. Boost.Function. Boost. http://www.boost.org/doc/html/function.html.
 
6
Aleksei Gurtovoy and David Abrahams. The Boost C++ metaprogramming library. www.boost.org/libs/mp1, 2002.
 
7
Pete Becker. Working draft, standard for programming language C++. Technical Report N2009=06-0079, ISO/IEC JTC 1, Information Technology, Subcommittee SC 22, Programming Language C++, April 2006.
 
8
Douglas Gregor. Variadic templates for GCC. http://www.osl.iu.edu/~dgregor/cpp/variadic-templates.html, August 2006.
 
9
Vesa Karvonen and Paul Mensonides. The Boost Preprocessor library, http://www.boost.org/libs/preprocessor/doc/index.html, July 2001.
 
10
Douglas Gregor. {libstdc++ patch} trl::bind, take 2. GNU libstdc++ mailing list, March 2005. http://gcc.gnu.org/ml/libstdc++/2005--03/msg00367.html.
 
11
 
12
Howard E. Hinnant, Dave Abrahams, and Peter Dimov. A proposal to add an rvalue reference to the C++ language. Technical Report N1690=04-0130, ISO/IEC JTC 1, Information technology, Subcommittee SC 22, Programming language C++, September 2004. http://www.open-std.org/jtcl/sc22/wg21/docs/papers/2004/n1690.html.
 
13
Joel de Guzman. The Spirit C++ parser framework. http://spirit.sourceforge.net, 2006.
 
14
 
15
Todd L. Veldhuizen. C++ templates are Turing complete, www.osl.iu.edu/~tveldhui/papers/2003/turing.pdf, 2003.
 
16
Matt Austern. (Draft) Technical Report on Standard Library Extensions. Number N1660=04-0100 in ISO C++ Standard Committee 2004--07 mailing, 2004.
 
17
 
18
ECMA. C# Language Specification, June 2005. http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-334.pdf.
 
19
David A. Hall. Variable number of generic params. Java bug report 6261297: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6261279, 2005.
 
20
Walter Bright. D programming language. http://www.digitalmars.com/d/, 2006.
 
21
22
23
 
24
Samuel Krempp. The Boost Formatambda library. http://www.boost.org/libs/format, 2002.
 
25
 
26
Douglas Gregor, Gary Powell, and Jaakko Järvi. Typesafe variable-length function and template argument lists. Number N1483=03-0066 in ISO C++ Standard Committee Post-Oxford mailing, April 2003.
 
27
Douglas Gregor, Jaakko Järvi, and Gary Powell. Variadic templates. Number N1603=04-0043 in ISO C++ Standard Committee Pre-Sydney mailing, February 2004.
 
28
Douglas Gregor, Jaakko Järvi, and Gary Powell. Variadic templates: Exploring the design space. Number N1704=04-0144 in ISO C++ Standard Committee Pre-Redmond mailing, September 2004.


Collaborative Colleagues:
Douglas Gregor: colleagues
Jaakko Järvi: colleagues