DIP proposal: Enum parameters

Timon Gehr timon.gehr at gmx.ch
Tue Sep 27 14:10:35 UTC 2022


On 27.09.22 14:13, Paul Backus wrote:
> 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.

This is not true, it is adding new capabilities. (E.g., due to overloading.)


More information about the Digitalmars-d mailing list