Hi All,

say, I have a class TTree<T>; in the destructor of that class, is it
possible to know the actual type of T? I want to do things like:

generic TTree<T> = class
public
  Data: T;
  destructor Destroy; override;
end;

destructor TTree.Destroy;
begin
  ... ...
  if Data is TObject then Data.Free;
end;

But "is" does not work with generic types.

Regards,
Xiangrong
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to