DIP proposal: Enum parameters

Paul Backus snarwin at gmail.com
Tue Sep 27 12:13:53 UTC 2022


On Tuesday, 27 September 2022 at 11:52:03 UTC, bauss wrote:
> Like how is this:
>
> ```
> auto opSlice()(enum size_t l, enum size_t u) => slice!(l, u);
> ```
>
> An improvement over:
>
> ```
> auto opSlice(size_t l, size_t u)() => slice!(l, u);
> ```
>
> Maybe I am not entirely grasping this concept or something.

The only difference is that at the call site, you can write 
`opSlice(i, j)` instead of `opSlice!(i, j)`. It's pure syntax 
sugar.


More information about the Digitalmars-d mailing list