[Issue 4799] New: template alias parameters cannot take 'this'

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 3 08:11:41 PDT 2010


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

           Summary: template alias parameters cannot take 'this'
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: zan77137 at nifty.com


--- Comment #0 from SHOO <zan77137 at nifty.com> 2010-09-03 08:11:24 PDT ---
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.

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