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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 6 10:19:41 PST 2011


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


Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com


--- Comment #1 from Walter Bright <bugzilla at digitalmars.com> 2011-03-06 10:16:43 PST ---
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().

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