Templates

Templates works great until you try to understand one of it's error messages


Templates and Metaprogramming - 2013

Int To Type

Generates a distinct type for each distinct constant int value. The value is also stored in the enum member variable. Ref: http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Int-To-Type

template <int v>

struct Int2Type

{

enum { value = v}

};

Variadic templates in C++ - 2014

SFINAE and enable_if - 2014

Short-circuiting in meta-functions - 2019