[fpc-pascal] Is it possible to know the data type of a specialized generics class?
Xiangrong Fang
xrfang at gmail.com
Tue Sep 24 11:53:18 CEST 2013
> But it's not a good idea as you'd still need to convert Data to a TObject
> (e.g. by using a cast), but that will fail if Data is something else than a
> pointer-like type...
>
> This worked in my TTree class (destructor):
if PTypeInfo(TypeInfo(Data))^.Kind = tkObject then TObject(Data).Free;
I don't know in what case it will fail? I tested with a TStringTree, could
you please give an example that it will fail?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130924/d3321557/attachment.html>
More information about the fpc-pascal
mailing list