Posts
Asserting compilation errors in C++
August 28, 2014•554 words
Sometimes when crafting an interface, we want to ensure that some illegal constructs leads to compilation errors. After all, a good interface is ea...
strings as types
March 31, 2013•1,061 words
As odd as it may seem, I have more than once felt the need to express a string literal as a unique type which can be used as a any class. As an exa...
Compile time messages in C++
September 28, 2011•983 words
At times it's desirable to give a message at compile time. Sounds cheezy, eh? Well read on and find out. As an example of the cheezy kind, the comp...
Compile time quick sort using C++ variadic templates
September 23, 2011•1,859 words
Edit June 4th 2015: This article is very dated. Read this revisiting article for a far better solution C++ is a strange language. In many ways it's...