Here are some technical details abom switch·statements:
1. The value on which we switch must be of an integer, char, or enumeration type. In particular, you cannot switch on a string.
2. The values in the case labels must be constant expressions. In particular, you cannot use a variable in a case label.
3. You cannot use the same value for two case labels.
4. You can use several case labels for a single case.
5. Don't forget to end each case with a break. Unfortunately, the compiler won't warn you if you forget.
In other words, the use of strings in switch cases, is not part of the ISO C++ standard.
The switch statement lets you implement a jump table in a high level language. It exists because jump tables are absurdly fast. Basically, you can use the switch value as the index into a table to find the appropriate case statement. Since you can't do that with a non-integral type, the language requires that you use a series of if/then/else statements instead, or somehow map the strings to integral values and switch off of those.