[fpc-pascal] Generic type parameter variable initialization
Sven Barth
pascaldragon at googlemail.com
Thu Jan 5 16:38:50 CET 2012
Am 05.01.2012 15:51, schrieb kyan:
> On Thu, Jan 5, 2012 at 4:03 PM, Florian Klämpfl<florian at freepascal.org> wrote:
>> Am 05.01.2012 14:19, schrieb Sven Barth:
>> Has the workaround really the same effect? I really wonder why there is
>> a need for default then ...
>
> Yes, works for Variants as well. Look at the implementation of
> System._FinalizeArray() in Delphi; it handles tkVariant type kind.
Saying a FPC compiler developer to look at the Delphi implementation is
problematic, because than we could get accused of copying code (which is
why I use the Delphi XE starter version which does not contain the
source code of the RTL and VCL).
> Come to think of it, it can be elegantly wrapped up in the following
> generic class:
While this does indeed look nicely it's still not Delphi compatible ;)
Regards,
Sven
More information about the fpc-pascal
mailing list