<p>I'm told that the template system in C++ is Turing-complete at compile time. This is mentioned in <a href="https://stackoverflow.com/questions/75538/hidden-features-of-c#75627">this post</a> and also on <a href="http://en.wikipedia.org/wiki/C%2B%2B" rel="noreferrer">wikipedia</a>.</p>

<p>Can you provide a nontrivial example of a computation that exploits this property?</p>

<p>Is this fact useful in practice?</p>

"
C++ Templates Are Turing Complete
" gives an implementation of a Turing machine in templates ... which is non-trivial and proves the point in a very direct way.  Of course, it also isn't very useful!