"BCS" <n...@anon.com> wrote in message news:a6268ffdcb78cc43db75126...@news.digitalmars.com... > > Just jumping a ways down this rabbit hole... > > struct S { int i; int opCmp(S s) { return i-- == s.i++; } > > { > S a,b,c,d,e; ... > switch(a) > { > case b: break; > case c: break; > case d: break; > case e: break; > } > } > > Oh, boy. What the hack does the above do? >
It blatantly abuses operator overloading ;) Start doing stuff like that, and you'll wind up in wonderland even without changing switch.