Avoid if-else branching in string to type dispatching
问题 Usually when you write a CLI tool which accepts parameter you have to deal with them. Most of the time you want to switch between behaviours based on the value of an argument. The following is a common use case, where the program accepts a type and then prints something based on that type. I am using Boost to pre-process and auto generate the whole if-else branches. This is very nice in terms of maintainability as I only need to update a define when I introduce a new type. On the other hand