www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6392] New: function pointers should be convertible to delegates

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6392

           Summary: function pointers should be convertible to delegates
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: gor boloneum.com



---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 28 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6392


Steven Schveighoffer <schveiguy yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |schveiguy yahoo.com
         Resolution|                            |WONTFIX



07:53:59 PDT ---
There is already a library solution: 
http://www.d-programming-language.org/phobos/std_functional.html#toDelegate

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 28 2011