[fpc-devel] RFE: Static virtual variables
Thaddy
thaddy at thaddy.com
Thu Oct 16 16:50:50 CEST 2008
Alexander Klenin wrote:
> FStat: Integer; static; virtual;
>
> Creates one instance of the variable per class, including derived classes.
> To implement it, compiler might either reserve a VMT slot for a pointer
> to the variable instance or just assign a fixed offset from the VMT.
>
Hallvard Vassbotn (and others) has published about the same idea (with
implementation) for Delphi. Should work for FPC too, but is a nice to
have on the language level.
See
http://hallvards.blogspot.com/2007/05/hack17-virtual-class-variables-part-i.html
and the second part as well as his original reference.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: multipart/alternative
Size: 1 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20081016/4c7496c6/attachment.bin>
-------------- next part --------------
No virus found in this outgoing message.
Checked by AVG - http://www.avg.com
Version: 8.0.173 / Virus Database: 270.8.1/1728 - Release Date: 16-10-2008 7:38
More information about the fpc-devel
mailing list