Re: fuction Return function

2014-07-26 Thread Meta via Digitalmars-d-learn
On Saturday, 26 July 2014 at 20:49:30 UTC, seany wrote: Can a function return a function in D? Sorry if i missed the answer somewhere Yup, you can return functions, delegates, or function pointers. int function(int) returnsFunc1() { return function(int n) { return n; }; } int function

Re: fuction Return function

2014-07-26 Thread sigod via Digitalmars-d-learn
On Saturday, 26 July 2014 at 20:49:30 UTC, seany wrote: Can a function return a function in D? Sorry if i missed the answer somewhere Just alias your function signature: ```d alias MyFunctionType = void function(int); ``` Example from my own code: ```d alias DeserializeBody = TLObject functio