[Home]Implementation quantities

Template parameter list length limitations

Because the language does not provide a way to declare a [class] template with variable number of template parameters, any metaprogramming library that appears to give its users a variadic interface to any of its components is in fact emulating these variable-length template parameter lists using default template arguments (14.1 [temp.param] para 9) and a certain amount of code repetition (either manual, or automated by using external tools/standard C preprocessor). Because any static code repetition is finite, these libraries are inevitably limited in the size of template parameter lists they can handle without resorting to less intuitive/idiomatic interfaces. As one might expect, boost::mpl library is not an exception here, although in practice the approach it takes is flexible enough to make this limitedness a non-issue.

[Description of the approach the library takes to make length of the parameter lists customizable, including reference to the PREPROCESSOR library and description of BOOST_MPL_PARAMETER_LIST_SIZE and other similar macros]

Number of recursively nested template instantiations

Appendix B ("Implementation quantities") of the ISO C++ Standard recommends the number 17 as the minimum for the recursively nested template instantiations quantity. Basically, it means that ??


Table of Content | RecentChanges | Index | Preferences | Site maintenance
Edit text of this page | View other revisions | Formatting rules
Last edited February 18, 2002 11:51 am (diff)
Search: