[fpc-pascal] Class/Record helpers on genericd?
Sven Barth
pascaldragon at googlemail.com
Tue Apr 26 07:57:11 CEST 2016
Am 25.04.2016 22:44 schrieb "Anthony Walter" <sysrpl at gmail.com>:
>
> Sven,
>
> Correct me if I'm wrong, but didn't you add support for class/record
helpers on generics? For example I'd like to be able to add methods to
dynamic arrays:
>
> type
> TArray<T> = array of <T>;
> TCompare<T> = function(constref A, B: T): Integer;
>
> TArrayHelper<T> = record helper for TArray<T>
> private
> ...
> public
> procedure Sort(Compare: TCompare);
> function First: T;
> function Last: T;
> function Random: T;
> // and so on
> end;
>
> As it is right now the compiler will not allow this.
No, I did not and it's also not planned.
Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160426/d47806bd/attachment.html>
More information about the fpc-pascal
mailing list