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

Paul Backus snarwin at gmail.com
Tue Dec 12 02:03:08 UTC 2023


On Monday, 11 December 2023 at 23:21:45 UTC, Quirin Schroll wrote:
> I always thought you had to provide aliases with all 16 
> combinations of the attributes `@safe`, `@nogc`, `pure`, and 
> `nothrow` for each actually desired instance. But you don’t and 
> **I have no clue why**.
>
> Why does it work?

Truly bizarre. I can't think of any explanation other than a 
compiler bug. Probably not a good idea to rely on this, even if 
the result is pretty handy.


More information about the Digitalmars-d-learn mailing list