Olivier Goffart wrote: > Instead, I would suggest something similar to llvm::StringSwitch > http://code.woboq.org/llvm/llvm/include/llvm/ADT/StringSwitch.h.html
Ewww, this is horrible! It will evaluate ALL the result values passed to it, whether the cases match or not. That works if the values are just enum constants, as in their example, but if you have any function calls in it, the complexity and side effects (!) of EVERY function call get triggered. Plus, in that case, you'd be taking and storing the address of a temporary, which is a very very bad idea by itself. So this is a very dangerous class. At most, this can be used to convert the strings into an integer or enum to feed into a real switch that does the actual work. Kevin Kofler _______________________________________________ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development