Bug 6392 – function pointers should be convertible to delegates

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2011-07-28T07:43:00Z
Last change time
2011-07-28T07:53:59Z
Assigned to
nobody
Creator
gor

Comments

Comment #0 by gor — 2011-07-28T07:43:45Z
if a delegate is a fat pointer, containing the context pointer and the function pointer, why isn't it legal to have a context pointer of null, allowing any function to be viewed as a delegate? It will save lots of effort, making duplicates of code for function pointers and delegates. To resolve the problem of the hidden context parameter of the delegate function, for example, a simple test for null may be used to determine whether the context pointer should be passed or not.
Comment #1 by schveiguy — 2011-07-28T07:53:59Z