Compile time sequences in D are insane, not insane "crazy" but insanely interesting. One of the selling points of D is that it takes compile time programming in C++ to another level, where templates in C++ were a 'happy?' accident, in D they were purposely built into the language along with other generic and meta-programming tools. To highlight this aspect of the D language, we will implement a selection of templates to manipulate compile time sequences of types, only the text
function from the standard library in the std.conv
module will be imported which is for concatenating text, we will build everything else including AliasSeq
and Nothing
from the std.meta
module which they are easy one-liners.
This article builds on the concepts of a