typeid + toString = runtime error

Zhenya zheny at list.ru
Sun Dec 30 07:32:17 PST 2012


Hi!
Explain me please why this code fails in runtime:

import std.stdio;

class Foo
{
	~this() {writeln(typeid(this).toString ~ "is dead");}
}

void main()
{
	new Foo;
}

Application error:
core.exception.InvalidMemoryOperationError


More information about the Digitalmars-d-learn mailing list