Re: How to get runtime type of this?

2013-10-04 Thread Zhouxuan
On Friday, 4 October 2013 at 08:23:11 UTC, Jacob Carlborg wrote: On 2013-10-04 10:03, Zhouxuan wrote: import std.stdio; class A { static int id = 0; this() { writeln("typeid=", typeid(this)); writeln("id=",typeof(this).id); //how to get ru

Re: How to get runtime type of this?

2013-10-04 Thread Zhouxuan
On Friday, 4 October 2013 at 08:23:11 UTC, Jacob Carlborg wrote: On 2013-10-04 10:03, Zhouxuan wrote: import std.stdio; class A { static int id = 0; this() { writeln("typeid=", typeid(this)); writeln("id=",typeof(this).id); //how to get ru

How to get runtime type of this?

2013-10-04 Thread Zhouxuan
import std.stdio; class A { static int id = 0; this() { writeln("typeid=", typeid(this)); writeln("id=",typeof(this).id); //how to get runtime type of this ?? } } class B : A { static int id = 1; } class C : A { static int id =

Bug again?

2013-10-03 Thread Zhouxuan
mixin template test() { int next; } void foo(alias l, alias t)() { t.next = l.next; } void main() { struct A { int next; } A a; mixin test l1; mixin test l2; foo!(l1,a); //ok! f