retard:
> So what types does the regular switch accept in D 2 ?

It accepts all integral values, including all chars and true enums. It accepts 
strings but not arrays.

It doesn't accept floating point values, complex numbers (that are FP), 
structs, objects and associative arrays.

Eventually support for arrays and structs too can be added, someone in the D 
Wish list has asked for those two things, but so far I haven't found a need for 
this.

If D adds tagged structs, then switch can read their tag. Time ago I have 
thought about an opSwitch operator for structs/classes, that gets called by 
switch, but I haven had not enough need for something like this so far. So I 
have never asked for it.

Bye,
bearophile

Reply via email to