[Issue 11946] "need 'this' to access member" when passing field to template parameter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 3 08:16:53 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11946



--- Comment #33 from Kenji Hara <k.hara.pg at gmail.com> 2014-03-03 08:16:49 PST ---
(In reply to comment #30)
> I noticed Kenji wrote this on the D Wiki:
> http://wiki.dlang.org/Brush_Up_Language_Features#Nested_Symbols
> 
> The idea is to introduce "static alias" template parameters, which make it
> explicit if the alias parameter needs to transmit the symbol's context to the
> template (and thus nest the template within that context), or not. I think it
> is a sensible approach in lieu of automagically determining if that context is
> needed by the template (which Kenji claims is "mostly impossible").

In my thought, excepting lambdas, the context-inference feature is not
implementable, because it will make the mangling names of the function local
symbols unstable. (On lambdas, they have unique names in their declared scope,
so we can stop encoding their 'this' pointer into the mangled name.) So if we
really need to capture any symbols without their contexts, the idea "static
alias parameter" would be the most better solution.

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


More information about the Digitalmars-d-bugs mailing list