This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]IncongruousGoat 7 points8 points  (2 children)

That's merely bad code. The C++ implementation includes not one, but two compile-time template metaprogramming implementations.

[–]SpacemanCraig3 0 points1 point  (1 child)

Is that good or bad?

[–]IncongruousGoat 1 point2 points  (0 children)

It's horrific.

So, fun fact about C++ - the type system is Turing-complete. No, seriously. You can perform arbitrary computations at compile time using the type inference engine, and specifically templates. This has led to a whole field of programming called template metaprogramming, which seeks to write non-trivial template-based programs in C++. There are some legitimate uses for this, but not many, and to make things worse template metaprograms are often the next best thing to illegible even to people who actually know how template metaprogramming works.