Create instance of class specified by the fully qualified name classname. The class must either have no constructors or have a default constructor.
null if failed
1 module foo.bar; 2 3 class C 4 { 5 this() { x = 10; } 6 int x; 7 } 8 9 void main() 10 { 11 auto c = cast(C)Object.factory("foo.bar.C"); 12 assert(c !is null && c.x == 10); 13 }
Create instance of class specified by the fully qualified name classname. The class must either have no constructors or have a default constructor.