2016-05-10 22:33 GMT+02:00 Anthony Walter <sys...@gmail.com>:

> From your example code, the usage looks exactly like what I'd want. One
> question though. Would the magic code also work with var and out arguments?
>

Yes.


> That is with (note these functions are generic):
>
> procedure Foo1<T>(A: TArray<T>);
> procedure Foo2<T>(var A: TArray<T>);
> procedure Foo3<T>(out A: TArray<T>);
>
> Where each can be called with a TManagedArray<T> as the "A" argument
> without qualifying the Instance field?
>

Yes, anyway example is buggy because we don't have "type inference" for
generic methods/functions like in Java (which is on my TODO list), but is
possible to compile and run example like this:

var
  a: TManagedArray<Integer>;
begin
  Foo1<Integer>(a);
  Foo2<Integer>(a);
  Foo3<Integer>(a);

-- 
Best regards,
Maciej Izak
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to