Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2024-10

Generic type helper

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Thomas Kurz

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

Reply by email