Daemonize v0.1 - simple way to create cross-platform daemons

Philippe Sigaud via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Sun Aug 31 22:12:17 PDT 2014


On Sun, Aug 31, 2014 at 11:36 PM, Meta via Digitalmars-d-announce
<digitalmars-d-announce at puremagic.com> wrote:
>> I didn't know you could have an enum and extend it with a cast like this.
>
> This is not a good thing. Enums are supposed to denote a *closed*,
> enumerated set of items.

I agree.

> It's fine here (but IMO bad style) because the
> author expects there to be user-created values casted to Signal passed to
> functions/templates that expect a Signal, but this would wreak havoc on code
> that was expecting a valid enum value (by valid, I mean only one of the
> predefined enum values).

I was about to suggest final switch, until I saw this extension of
Signal. I wonder what happens to final switch in this case.


More information about the Digitalmars-d-announce mailing list