I was responding to kunos's question if any languages allowed the syntax he quoted.Ah, I thought your "some languages" was a not-so-subtle "hint hint", referring to C++ itself (What with the topic being about C++, and the "Close enough?" comment).Which is why I said "some languages" and not "c++ and some languages"
C++ switch statements only work with some data types (mostly ints) - not with std::strings. Even so, that's pretty ugly syntax.
Totally don't agree here. Switching on a variable is what switches are for.Not switches, per se, but using switches (which are typically meant to branch logic) to imitate the use of AND logic (which is what && is for).
Why do you think switches are ugly?
In some situations it may be the best solution, but in general I prefer to use if() when I mean logical IF, and && when I mean logical AND.