RFC: generic safety, specialized implementation?

Adam D. Ruppe destructionator at gmail.com
Fri Jan 19 19:37:20 UTC 2018


On Friday, 19 January 2018 at 19:18:22 UTC, Luís Marques wrote:
> So far this seems to be working well for me. Do you have 
> experience writing this kind of code? Do you have any advice 
> that might be relevant to this situation?

This is actually the way a lot of stuff is implemented in d 
runtime code, like the array helper functions (the interface done 
via a bit of magic in the compiler rather than templates mostly 
tho). I find it works in some cases with a bit smaller binary, 
little runtime speed change, and it can sometimes help compile 
speeds.

Of course, you can also sometimes use interfaces and classes to 
achieve this same goal.


More information about the Digitalmars-d mailing list