2 ms·
Not at all, originally template metaprogramming was discovered by accident. Cannot recall any longer if the original article on the matter appeared on The C/C+
by pjmlp 2y ago
Not at all, originally template metaprogramming was discovered by accident.
Cannot recall any longer if the original article on the matter appeared on The C/C++ Users Journal or Dr. Dobbs.
Eventually it started to get abused and the Turing completeness has been discovered.
Since C++11, the approach to a more sane way to do metaprogramming with templates has been improving.
Instead of tag dispatch, ADL and SFINAE, we can make use of concepts, if constexpr/eval/init, type traits, and eventually reflection, instead of the old clunky ways.
- troutwine 2y ago“C++ Templates are Turing Complete” by Todd L. Veldhuizen has the history of discovery, early elaboration.
- omoikane 2y agoLink to paper: http://web.archive.org/web/20131101122512/http://ubietylab.net/ubigraph/content/Papers/pdf/CppTuring.pdf http://web.archive.org/web/20131101122512/http://ubietylab.n... Via "Accidentally Turing-Complete": https://news.ycombinator.com/item?id=30189780 https://news.ycombinator.com/item?id=30189780