I dun a DIP, possibly the best DIP ever
Steven Schveighoffer
schveiguy at gmail.com
Fri Apr 24 12:08:00 UTC 2020
On 4/24/20 12:22 AM, Walter Bright wrote:
> On 4/22/2020 6:18 AM, Steven Schveighoffer wrote:
>> int double_int(int val) { return 2 * val; }
>>
>> T double_int(T val) { return val; }
>>
>> void double_ints(alias pred, T... args) {
>> pred(double_int(args)...);
>> }
>
> This can be done with the array syntax proposal using UFCS:
>
> void double_ints(alias pred, T... args) {
> args.pred();
> }
What's the array syntax proposal? The above seems not to invoke
double_int at all.
-Steve
More information about the Digitalmars-d
mailing list