[fpc-pascal] Generic routines for both dynamic array and other collections

Sven Barth pascaldragon at googlemail.com
Sun Feb 21 22:59:57 CET 2021


Am 21.02.2021 um 15:59 schrieb Ryan Joseph via fpc-pascal:
>
>> On Feb 20, 2021, at 7:52 PM, Виктор Матузенко via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
>>
>> And how do I write generic helper for all possible dynamic arrays?
> By hand sadly. The RTL has added type helpers for many types but I don't think they added these for dynamic arrays. I agree that dynamic arrays should have a "Count" method by default and the RTL should provide "array of T" for all intrinsic types.

You are supposed to use Length(X). There is no need for a "property". 
One doesn't need to objectify each and everything!

Regards,
Sven


More information about the fpc-pascal mailing list