Compiling the following code and got the error of type illegal
.
int main()
{
// Compilation error - switch expression of type illegal
sw
Late to the party, here's a solution I came up with some time ago, which completely abides to the requested syntax.
#include
int main()
{
uberswitch (std::string("raj"))
{
case ("sda"): /* ... */ break; //notice the parenthesis around the value.
}
}
Here's the code: https://github.com/falemagn/uberswitch