Use UFCS for reducing dependencies

Adam D Ruppe destructionator at gmail.com
Mon Jul 18 12:56:08 UTC 2022


On Monday, 18 July 2022 at 12:46:20 UTC, Paul Backus wrote:
> But the basic idea is, you declare your `load` function as 
> taking a generic range type, and then you can load from 
> anything that implements the appropriate range interface.

https://github.com/adamdruppe/arsd/blob/master/png.d#L1145

This was actually one of the first times I tried to write a range 
consumer, so.... not very good code. (Hit the git blame button 
and find that whole block was committed in June 2013... before I 
wrote the range chapter of my book lol)

But still, it shows the rough concept in a real implementation.


More information about the Digitalmars-d mailing list