How can I know if an object (TObject) is a generic TList<T>
.
The object I get can be a TList<TWhateverObject>
or just a TWhateverObject
Can also be a TList<THelloWorld>
In my code I won't use this:
If (oObject is TList<TWhateverObject>) or
(oObject is TList<THelloWorld>)
then begin
oObject.Free;
end;
But if possible more like this:
If (oObject.IsList)
then begin
oObject.Free;
end;
Is there some function in Delphi for that or must I create a helper for TObject (IsList) that search in the RTTI if property add, clear, items, count exist in the object.