[fpc-devel] Feature request/discussion - SetLengthNoInit
Sven Barth
pascaldragon at googlemail.com
Wed Sep 16 17:12:37 CEST 2020
J. Gareth Moreton via fpc-devel <fpc-devel at lists.freepascal.org> schrieb am
Mi., 16. Sep. 2020, 16:10:
> I did wonder if it was possible to use an object of some kind or, I dare
> say, some evil low-level manipulation of its internal structure wrapped
> into a convenient function that, say, calls ReallocMem on the internal
> pointer and sets the length field as normal. The trouble is, that will
> be inherently unsafe on account that you can't pass an untyped dynamic
> array as a formal parameter ("array of const" is, as the name implies,
> an array of constants that's just a list).
>
"array of const" is internally an "array of TVarRec" and can be used for
non constants as well (there values will be copied to the open array).
Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20200916/6749acc1/attachment.htm>
More information about the fpc-devel
mailing list