function pointer when a function is overloaded.
deadalnix
deadalnix at gmail.com
Sun Jul 1 06:28:41 PDT 2012
Le 01/07/2012 01:59, dnewbie a écrit :
> import std.stdio;
>
> alias void function(int) fooInt;
> alias void function(long) fooLong;
>
> int main(string[] args)
> {
> fooInt f1 = &foo;
> fooLong f2 = &foo;
> f1(1L);
> f2(1L);
> return 0;
> }
>
> void foo(int i)
> {
> writeln("foo(int i)");
> }
>
> void foo(long i)
> {
> writeln("foo(long i)");
> }
Thanks.
More information about the Digitalmars-d-learn
mailing list