转载,"Using C++ template metaprograms," C++ Report Vol. 7 No. 4 (May 1995), pp. 36-43.
Template Metaprograms
Todd Veldhuizen
Introduction
Compile-time programs
The introduction of templates to C++ added a facility whereby the compiler can act as an interpreter. This makes it possible to write programs in a subset of C++ which are interpreted at compile time. Language features such as for loops and if statements can be replaced by template specialization and recursion. The first examples o阅读全文>
发表于 @ 2006年06月11日 17:17:00|评论(loading...)|编辑