Function overloading question
Márcio Faustino
m.faustino at no.spam.gmail.com
Mon Aug 27 01:15:14 PDT 2007
Kirk McDonald wrote:
> void foo(int) {}
> void foo(double) {}
>
> There are two ways:
>
> void function(int) fn1 = &foo;
> void function(double) fn2 = &foo;
>
> These will each get the proper overloads. Alternately:
>
> auto fn3 = cast(void function(int)) &foo;
> auto fn4 = cast(void function(double)) &foo;
>
> This will also work.
>
Thanks!
More information about the Digitalmars-d-learn
mailing list