Converting Java code to D

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Apr 20 10:24:29 PDT 2015


John Colvin:

> struct LineStyle
> {
>     enum NONE = "None";
>     enum SOLID = "Solid";
>     enum DASH = "Dash";
>     enum DOT = "Dot";
>     enum DASHDOT = "Dash Dot";
>     enum DASHDOTDOT = "Dash Dot Dot";
>
>     string label;
>
>     private this(string label)
>     {
>         this.label = label;
>     }
> }

The constructor doesn't look very useful.

Perhaps a named enum is safer.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list