X-Git-Url: https://git.llucax.com/software/druntime.git/blobdiff_plain/b29ba2914571d42232476d23c06a9f79291f7646..234ae5d9d62e8edcd9555c075cb5b1f404ef67a7:/src/compiler/dmd/object_.d diff --git a/src/compiler/dmd/object_.d b/src/compiler/dmd/object_.d index df5cfff..4e78220 100644 --- a/src/compiler/dmd/object_.d +++ b/src/compiler/dmd/object_.d @@ -66,7 +66,7 @@ else } alias size_t hash_t; -alias int equals_t; +alias bool equals_t; alias invariant(char)[] string; alias invariant(wchar)[] wstring; @@ -125,6 +125,23 @@ class Object void lock(); void unlock(); } + + /****** + * Create instance of class specified by classname. + * The class must either have no constructors or have + * a default constructor. + * Returns: + * null if failed + */ + static Object factory(string classname) + { + auto ci = ClassInfo.find(classname); + if (ci) + { + return ci.create(); + } + return null; + } } /**