3 ms·
I would suggest if you have this feeling that you don't have a good grasp on metaprogramming. This link might help: http://www.parashift.com/c++-faq-lite/templ
by shawn-butler 14y ago
I would suggest if you have this feeling that you don't have a good grasp on metaprogramming. This link might help: http://www.parashift.com/c++-faq-lite/templates-defn-vs-decl.html http://www.parashift.com/c++-faq-lite/templates-defn-vs-decl...
Also the use of extern keyword for templates which is valid according to the standard is limited by compiler compliance. Kind of a chicken-egg problem, not a language problem.
Finally you might investigate the extern template keyword in c++11: http://en.wikipedia.org/wiki/C++11#Extern_template http://en.wikipedia.org/wiki/C++11#Extern_template
I have always wondered whether a grand rethinking of compilers/linkers wasn't in order given the radically different face of computing and computational resources available now as opposed to 30+ years ago.
- bo1024 14y ago> I would suggest if you have this feeling that you don't have a good grasp on metaprogramming. I don't think someone has to be an expert on metaprogramming to recognize the flaws in C++ (although I do think it helps).
- fulafel 14y agoor know c++ to be an expert in metaprogramming.
- loup-vaillant 14y agoSince 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").