2 ms·
Since you mention the FAQ, I just have to mention the FQA: http://www.yosefk.com/c++fqa/templates.html#fqa-35.12 http://www.yosefk.com/c++fqa/templates.html#fqa
by loup-vaillant 14y ago
Since you mention the FAQ, I just have to mention the FQA: http://www.yosefk.com/c++fqa/templates.html#fqa-35.12 http://www.yosefk.com/c++fqa/templates.html#fqa-35.12
More seriously, the primary use of template is not meta programming, but good old parametric polymorphism (or «genericity»). They are more capable than that, but only by accident. https://en.wikipedia.org/wiki/Turing_tarpit https://en.wikipedia.org/wiki/Turing_tarpit
If you want actual meta programming, look at Haskell combinator libraries, Lisp macros, and external DSLs (in ascending order of "meta").