Programming‎ > ‎Language‎ > ‎C++‎ > ‎

Templates

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

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}
};
Comments