opApply seems like it can infer delegate types AND parameters!?

Quirin Schroll qs.il.paperinik at gmail.com
Mon Dec 11 23:24:16 UTC 2023


On Monday, 11 December 2023 at 23:21:45 UTC, Quirin Schroll wrote:
> […]
> 1. Instead of implementing a function `opApply(scope int 
> delegate(...))`, write a function template 
> `opApplyImpl(DG)(scope int delegate(...))` (or whatever name) 
> and let it take the delegate type as a template type parameter.

[Correction] This should have been:

1. Instead of implementing a function `opApply(scope int 
delegate(...))`, write a function template 
**`opApplyImpl(DG)(scope DG)`** (or whatever name) and let it 
take the delegate type as a template type parameter.


More information about the Digitalmars-d-learn mailing list