Simple overloading without complications

Adam Sansier via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 12 06:44:02 PDT 2016


On Tuesday, 12 July 2016 at 08:52:26 UTC, Kagamin wrote:
> Extract functions for shared parts:
>
> void Do(string name)
> {
>     DoStuff();
>     int i = find(name);
>     DoStuffWithIndex(i);
> }
>
> void Do(int name)
> {
>     DoStuff();
>     DoStuffWithIndex(i);
> }

I don't like it, creates an extra function for no apparent reason 
except to get around the problem of not having a yield type of 
semantic. Again, I wasn't asking for any ol' solution, there are 
many ways to skin this cat.





More information about the Digitalmars-d-learn mailing list