Thread overview | |||||
---|---|---|---|---|---|
|
September 27, 2006 [Issue 380] New: cannot use typeof(*this) in a static context | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=380 Summary: cannot use typeof(*this) in a static context Product: D Version: 0.167 Platform: PC OS/Version: Windows Status: NEW Severity: minor Priority: P3 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: h3r3tic@mat.uni.torun.pl struct Foo { alias typeof(*this) ThisType; } > 'this' is only allowed in non-static member functions > can only * a pointer, not a 'int' workaround: struct Foo { alias typeof(*typeof(this).init) ThisType; static assert (is(Foo == ThisType)); } -- |
September 29, 2006 Re: [Issue 380] New: cannot use typeof(*this) in a static context | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail Attachments: | d-bugmail@puremagic.com schrieb am 2006-09-27: > http://d.puremagic.com/issues/show_bug.cgi?id=380 > struct Foo { > alias typeof(*this) ThisType; > } > > >> 'this' is only allowed in non-static member functions >> can only * a pointer, not a 'int' > > > > workaround: > > struct Foo { > alias typeof(*typeof(this).init) ThisType; > static assert (is(Foo == ThisType)); > } Added to DStress as http://dstress.kuehne.cn/compile/t/typeof_10_A.d http://dstress.kuehne.cn/compile/t/typeof_10_B.d http://dstress.kuehne.cn/compile/t/typeof_10_C.d http://dstress.kuehne.cn/compile/t/typeof_10_D.d Thomas |
November 25, 2006 [Issue 380] cannot use typeof(*this) in a static context | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=380 bugzilla@digitalmars.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #2 from bugzilla@digitalmars.com 2006-11-25 03:51 ------- Fixed DMD 0.175 -- |
Copyright © 1999-2021 by the D Language Foundation