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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 23 21:34:17 PST 2014


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



--- Comment #18 from Vladimir Panteleev <thecybershadow at gmail.com> 2014-01-24 07:34:14 EET ---
OK, but when I said:

> "static" must not affect whether alias parameters receive context pointers.
[snip]
> "static" must only untie the function from its
> immediate surrounding declaration context (struct, class or function frame).

I specifically meant this case. It should not matter whether the function is in
a template or not, if it is not declared in a struct/class/function, then
"static" should have no effect (or even be forbidden, as the compiler now
forbids many senseless attributes). With your change, "static" is still used as
a mechanism to tell the compiler whether the function needs the context at the
INSTANTIATION site, which should not be necessary, as I said in comment#13 the
compiler should instantiate/evaluate the function regardless of whether a
context pointer is needed, and if the function's code actually needs the
context pointer then the compiler will complain at that point.

But to get back on topic, you said that you're not sure if this problem will
ever be solved. But there have been a few unanswered suggestions here and in
the other discussion you mentioned, do you think they are all unfeasible?

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