type Parent = class
constructor create(const str: string);
end;
type ClassOfParent = class of Parent;
function fact(ClassType: ClassOfParent; const str: string): Parent;
begin
result := ClassType.Create(str);
end;
type Parent = class
constructor create(const str: string);
end;
type ClassOfParent = class of Parent;
function fact(ClassType: ClassOfParent; const str: string): Parent;
begin
result := ClassType.Create(str);
end;