
14 Sep
2008
14 Sep
'08
4:43 p.m.
Kasra (Math & ComSci) wrote:
The library should do something like:
BOOST_SWITCH( "hello world" ) { BOOST_CASE( "hello" ): BOOST_CASE( "world" ): ... break; BOOST_DEFAULT: ... };
I hardly see how this could work for a O(1) lookup (the point of the switch statement). For it to work on strings, you would need to work to provide the possibilities as compile-time strings and generate an automaton with nested switch statements. Something like that, yes, that would be very useful. I suppose the switch_ utility can be reused to simplify matters.