[fpc-pascal] Generic type helper

Thomas Kurz fpc.2021 at t-net.ruhr
Thu Oct 31 18:27:36 CET 2024


Hello,

a quick question: how do I define a generic type helper?

Example:

type generic TArray<T> = array of T;
type generic TArrayHelper<T> = type helper for TArray
  function Count: Cardinal;
  function Contains (AItem: T): Boolean;
end;

This doesn't work, but I don't know how to do it properly.

Thanks,
Thomas  



More information about the fpc-pascal mailing list