Whenever you are building a system that has it's own type system you will come to a point where you perform type dependent operations. If your types seamlessly map to standard integral types most of the mapping code and extraction can be handled by simple template methods, but from time to time you will find the following code fragments: {% highlight c++ %} switch(type) { case IntegerType: /**/ do_something_important(value); break; case DoubleType: /**/ do_something_important(value); break; } {% endhighlight %} Interestingly the only difference in the above code line is only the requested type. A concrete example is e.g. hashing of...