Discriminated Unions

bearophile bearophileHUGS at lycos.com
Mon Nov 18 16:43:13 PST 2013


> Base step(in Base b, in int delta) {
>     final switch (b.type) with (b) {
>         case intType:    return Base(b.get!int + delta);

Or better:

final switch (b.type) with (b.Types) {

Bye,
bearophile


More information about the Digitalmars-d mailing list