
Hello to all; I came up with an idea of extending the current switch functionality using library extensions. The problem is mostly when we have char[] (or any other object) in the switch statement: void do_switch(const char *cstr) { switch( cstr ) { case "Sunday": case "Saturday": ... break; case "Monday": ... }; } Obviously we can't do this using C++ alone, so if we have something like BOOST_SWITCH() which would accomplish this would be great. I have a runtime solution (with need of some attention) for this, however, a compile time solution is desirable. The library should do something like: BOOST_SWITCH( "hello world" ) { BOOST_CASE( "hello" ): BOOST_CASE( "world" ): ... break; BOOST_DEFAULT: ... }; (Please don't suggest 'enum' solutions since they are not as dynamic and are confined to very small domain) Any suggestions, ideas & etc? With best regards Kasra