Hacker News new | past | comments | ask | show | jobs | submit login

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.




“C++ Templates are Turing Complete” by Todd L. Veldhuizen has the history of discovery, early elaboration.





Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: