5

C++ Templates are Turing-Complete

 3 years ago
source link: https://belkadan.com/blog/2009/05/C-plus-plus-Templates-are-Turing-Complete/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

C++ Templates are Turing-Complete

Apologies to anyone reading. These last few weeks are very busy and I do not have time for a legitimate post. Hopefully things will be more regular later…?

So meanwhile, I present this semi-formal proof that the C++ template system is Turing-complete, shown to me by a friend. This means that, among other things, a C++ program that uses templates can (theoretically) take both infinite time and infinite space to compile!

I am not a C++ fan, though it has a few features I appreciate. But give me a nice OO system, with a solid C-language interface…Objective-C does not quite fit, because you still have to live with the lingering bits of C. Ah, well…

This entry was posted on May 05, 2009 and is filed under Technical. Tags: C++, Programming languages


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK