Overloading free functions & run-time dispatch based on parameter types

Nicholas Wilson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Feb 5 03:10:36 PST 2016


On Friday, 5 February 2016 at 10:54:27 UTC, Robert M. Münch wrote:
> From the docs:
>
> class A { }
> class B : A { }
> class C : B { }
> void foo(A);
> void foo(B);
>
> [...]

sounds like foo should just be a method in the class rather than 
a free function


More information about the Digitalmars-d-learn mailing list