Is there any hope for "lazy" and @nogc?
Steven Schveighoffer
schveiguy at gmail.com
Sat Aug 4 21:07:10 UTC 2018
On 8/4/18 3:07 PM, Jacob Carlborg wrote:
> On 2018-08-02 13:33, Steven Schveighoffer wrote:
>
>> // variadic lazy paramters
>> void bar(int delegate()[] items...)
>> {
>> writeln(items[0]());
>> writeln(items[1]());
>> writeln(items[2]());
>> }
>
> I'm surprised that this doesn't need to be called with a delegate
> syntax, i.e.
>
> bar({ return 0; });
>
See one of the earlier posts, it's a lazy variadic function. A
little-known D feature.
-Steve
More information about the Digitalmars-d
mailing list