Bug 4799 – template alias parameters cannot take 'this'
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-09-03T08:11:00Z
Last change time
2011-05-07T06:20:37Z
Keywords
rejects-valid
Assigned to
nobody
Creator
zan77137
Comments
Comment #0 by zan77137 — 2010-09-03T08:11:24Z
This code doesn't work:
----------------------------------------------------
template Template(alias v){ bool Template = true; }
class C
{
void func() { assert(Template!(this)); }
}
----------------------------------------------------
Results:
prog.d(5): Error: expression this is not a valid template value argument
prog.d(5): Error: template instance prog.Template!(this) error instantiating
I wondered whether it is specified behavior.
But, I think this code should be able to compile.
Comment #1 by k.hara.pg — 2011-05-07T06:20:37Z
*** This issue has been marked as a duplicate of issue 693 ***