Passing function as values and returning functions

Xan xancorreu at gmail.com
Wed Apr 11 11:28:38 PDT 2012


On Wednesday, 11 April 2012 at 13:04:01 UTC, Steven Schveighoffer 
wrote:
> On Wed, 11 Apr 2012 08:53:00 -0400, Xan <xancorreu at gmail.com> 
> wrote:
>
>>
>> Thanks, Steve, but another problem:
>>
>
> [snip]
>
>> void main() {
>> |___writeln(g(f)(1));
>> }
>
> writeln(g(&f)(1));
>
> Unlike C, you *must* take the address of a function symbol to 
> get a function pointer.
>
> -Steve

Yes, it works, finally.

Thanks, Steve.

Xan.



More information about the Digitalmars-d-learn mailing list