one of the simplest, most powerful metaprogramming techniques that exist in C++: tag dispatching.

Rest of the article here