Hi, is it possible to have a virtual class variable? I want to have a
pointer available per class that can be a different value.
Something like this:
TA = class
class var Foo: TObject; virtual;
end;
TB = class(TA)
class var Foo: TSpecialObject; override;
end;
I have in
My current idea for a solution is here:
http://pastebin.com/P3JsDQ03
Can anyone think of something with less code? I guess I could save a
little if I skip the property and directly use GetVMT and SetVMT.
Regards,
Andrew
___
fpc-pascal maillist -
07.08.12, 8:18, Andrew Haines wrote:
Hi, is it possible to have a virtual class variable? I want to have a
pointer available per class that can be a different value.
Something like this:
TA = class
class var Foo: TObject; virtual;
end;
TB = class(TA)
class var Foo:
On 08/06/12 23:02, Paul Ishenin wrote:
Class variable is stored the same way as a regular variable and has the
only difference is that it can be accessible with the class name prefix.
The thing you need requires different implementation - something like
storing a virtual class variable in
07.08.12, 11:24, Andrew Haines wrote:
What is the current implementation?
I would guess that class vars are stored in the vmt already...
No, class var and regular variable has no difference except the scope.
It is a static variable which is shared between all instances and
descendants - so
Ahhh ok I understand now. , Thank you.
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
Paul Ishenin paul.ishe...@gmail.com wrote:
07.08.12, 11:24, Andrew Haines wrote:
What is the current implementation?
I would guess that class vars are stored in the vmt already...