DIPX: Enum Literals / Implicit Selector Expression

russhy russhyy at gmail.com
Fri Dec 3 13:54:16 UTC 2021


On Friday, 3 December 2021 at 09:36:46 UTC, bauss wrote:
> Or even:
>
> ```d
>     Flags flags;
>     with(Flags) flags = FOO | BAR | BAZ | QUX;
>     // flags does exist here now.
> ```

the proposal is to specifically avoid having to be this repetitive

`Flags flags with Flags flags = ...`


This is way too much cognitive load only to get to the point of 
simply doing ``FOO | BAR | BAZ | QUX``


`with` when you think about using it, when you just want to use 
the enum it becomes cumbersome


More information about the Digitalmars-d mailing list