www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Automatic type expansion of functions to delegates?

reply Andrew Pennebaker <andrew.pennebaker gmail.com> writes:
Hey, do you think it would be possible for D to automatically 
expand more types, such as promoting functions to delegates? This 
would save us from having to write some boilerplate code.
Dec 08 2018
parent Adam D. Ruppe <destructionator gmail.com> writes:
On Sunday, 9 December 2018 at 02:02:51 UTC, Andrew Pennebaker 
wrote:
 Hey, do you think it would be possible for D to automatically 
 expand more types, such as promoting functions to delegates? 
 This would save us from having to write some boilerplate code.
It is pretty simple to just call toDelegate to do that conversion. D is unlikely to get more automatic conversions going forward, especially of built-ins. http://dpldocs.info/experimental-docs/std.functional.toDelegate.html
Dec 08 2018