[fpc-pascal] Support for "class threadvar" sections inside class and record types

Sven Barth pascaldragon at googlemail.com
Sat Jun 23 23:20:37 CEST 2018


Anthony Walter <sysrpl at gmail.com> schrieb am Sa., 23. Juni 2018, 22:56:

> Much thanks Sven! I'm note sure when I'll use it, but the option is always
> nice to have. A small question, since it's available in a class, does
> "class threadvar" support generics?
>
> {$mode delphi}
>
> type
>   TAnimal<T: TTrainer> = class
>   public class threadvar Trainer: T;
>   end;
>
> For everyone else, threadvar is the language integrated simplification of thread
> local storage <https://en.wikipedia.org/wiki/Thread-local_storage>.
>

In theory yes, but class variables inside generics currently don't work as
one expects (they never did) and will need quite an intensive fix.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20180623/a9e8006e/attachment.html>


More information about the fpc-pascal mailing list