[fpc-devel] Type range in generic

Sven Barth pascaldragon at googlemail.com
Mon Dec 3 08:05:48 CET 2018


Am Mo., 3. Dez. 2018, 00:33 hat Simon Jackson <jackokring at gmail.com>
geschrieben:

> Just an idea.
>
> Class variables. If generics are used, then the same code can be used for
> differing pointer types. (Classes) as long as a specifier on the "generic
> class variable" and no generic specialize or <> is in the
>
> class generic x: TObject;
>
> Can it be shared across all generics of a kind?
>
> The code density in the cache would be good for all common generics.
>

I don't see a use for such a feature.
What if one sets it as a descendant of one class, but another retrieves it
as a descendent of a completely different class? You'd have to use separate
storage locations then anyway and then you can simply use ordinary class
variables.

Regards,
Sven

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20181203/8bcb909b/attachment.html>


More information about the fpc-devel mailing list