[Issue 5710] cannot use delegates as parameters to non-global template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 21 18:16:42 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=5710


deadalnix <deadalnix at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |deadalnix at gmail.com


--- Comment #15 from deadalnix <deadalnix at gmail.com> 2013-01-21 18:16:38 PST ---
(In reply to comment #1)
> The reason this does not work is because the instantiation of the doStuff()
> function would require *two* context pointers:
> 
> 1. a 'this' pointer to the object Foo
> 2. a 'this' pointer to the stack frame of main()
> 
> and there can be only one.
> 
> It will work if you declare add() as being static, because then you're saying
> that it does not need a context pointer to main().

Why there could only be one ? I see no real problem about having 2 of them.

Note that I have plenty of workaround on top of several forms of that issue.

Passing the delegate as argument instead of alias is going to make things much
slower.

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


More information about the Digitalmars-d-bugs mailing list