December 2004
Intermediate to advanced
400 pages
8h 29m
English
Interpretation of template metaprograms is inherently inefficient. When a class template is instantiated, a C++ compiler must meet all the standard’s requirements, including matching against partial specializations, building an internal representation of the class, and recording the specialization in the template’s namespace. It may also have to meet requirements imposed by its own design or that of the environment, such as generating mangled symbol names for the linker or recording information for the debugger. None of these activities are directly related to the metaprogram’s intended computation.
This inefficiency manifests itself in the time it takes for a program to compile and in the resources used ...
Read now
Unlock full access