[fpc-pascal] procedure that accept generic types?

Xiangrong Fang xrfang at gmail.com
Wed Sep 4 08:18:26 CEST 2013


Hi There,

I try to write a procedure with generic parameters, but failed:

type
  generic TArray<T> = array of T;

procedure ProcessArray(arr: TArray<T>);
begin
end;


The compiler said "Generics without specialization cannot be used..."

But if I specialize the parameter then this procedure is useless.

Any ideas?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130904/3195aa3e/attachment.html>


More information about the fpc-pascal mailing list