1switch(str2int("my string"))
2{
3 case str2int("my string")):
4 {
5 }
6 break;
7}
8
9constexpr unsigned int str2int(const char* str, int h = 0)
10{
11 return !str[h] ? 5381 : (str2int(str, h+1) * 33) ^ str[h];
12}
13
1switch(expr) {
2 case 1:
3 // do something
4 break;
5 case 2:
6 // do something
7 break;
8 default:
9 // do something
10}