On 8/8/10, Andrej Mitrovic <[email protected]> wrote:
> I wonder if there's a way to get the static type, is there an equivalent
> function like typeid() for such a case?

Try this:

      typeid(typeof( X ));

typeof() returns the static type of the variable. Then, you can get
the typeid of that returned static type.

Here's a sample program:
====
import std.stdio;
class Something { }
class SomethingElse : Something {}

void main() {
        Something o = new SomethingElse;
        writeln(typeid(typeof(o)));
}
====
Prints: test6.Something

Reply via email to