Fallback 'catch-all' template functions

Ethan Watson via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 1 03:53:01 PDT 2016


On Thursday, 1 September 2016 at 10:43:50 UTC, Dominikus Dittes 
Scherkl wrote:
> I have never seen what benefit could be gained from having 
> overloads.

Oh, it's perfectly fine if you're not writing a library that's 
designed to allow user extension by going the "all in one" 
method. If you encourage your users to modify your function 
itself, they can no longer drop in a new version and have to do a 
merge.

Templates in general seem weak for libraries in D, which is a 
pain considering templates are one of the areas where the 
language otherwise excels.


More information about the Digitalmars-d mailing list