3 ms·
I have seen some ridiculous templates in C++. Isn't STL Turing complete?
by hacknat 9y ago
I have seen some ridiculous templates in C++. Isn't STL Turing complete?
- solipsism 9y agoYou're definitely talking about TMP, template metaprogramming. The STL is a set of useful libraries that do specific things. Like represent strings or vectors. Or sort, or generate random numbers. If anything the STL is too small. TMP, on the other hand, is an entirely separate language within C++ that allows you to create monstrous, arcane code that's incredibly hard to debug or understand. Some of the STL uses TMP. But it sounds like custom TMP is the thing you don't like.
- majewsky 9y agoC++ template metaprogramming is Turing-complete, except that in practice your loops are going to be cut short by the maximum recursion limit of the compiler (900 in g++, see -ftemplate-depth option).