Am 10.05.2011 23:19, schrieb Hans-Peter Diettrich:
Take e.g. a TObjectList, and replace all occurences of "TObject" by
"<T>", to make it a generic class:

TMyList<T> = class(TList)
...
function Add(AObject: <T>): Integer;
...
end;


You need to use "T", not "<T>". The "<T>" after the class name is basically a type declaration. You can use multiple types, too:

TMyDictionary<TKey, TValue> = class
  ...
  function Find(aKey: TKey): TValue;
  ...
end;

Regards,
Sven

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to