Registriert seit: 20. Jan 2006
Ort: Lübbecke
11.487 Beiträge
Delphi 12 Athens
|
AW: Generisches Interface und GUID
8. Feb 2012, 16:35
Noch besser!
Delphi-Quellcode:
var
int: IMyInterface<Integer>;
dbl: IMyInterface<Double>;
begin
int := TMyClass<Integer>.Create(1);
dbl := TMyClass<Double>.Create(0.1);
Assert(Supports(int, IMyInterface<Double>));
Assert(Supports(dbl, IMyInterface<Integer>));
int := dbl as IMyInterface<Integer>;
ShowMessage(IntToStr(int.Blub));
end;
|