Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!mintaka!snorkelwacker.mit.edu!ai-lab!rice-chex!rpk From: rpk@rice-chex.ai.mit.edu (Robert Krajewski) Newsgroups: comp.lang.c++ Subject: Re: Class instance variables (was Re: inheriting statics) Message-ID: <11936@life.ai.mit.edu> Date: 16 Nov 90 22:53:19 GMT References: <1990Nov13.072057.18707@Neon.Stanford.EDU> <1990Nov14.212657.5671@Neon.Stanford.EDU> Sender: news@ai.mit.edu Organization: MIT Artificial Intelligence Laboratory Lines: 14 Hmm. At first I was thinking, ``Well, you really can't class instance variables with the current C++ model because there really isn't a run-time expression of classes in C++.'' But if you have any virtual functions in a class, there *is* a per-class thing that lives at run-time -- its table of virtual functions. So maybe one could overload (!) the Vtable concept, and use negative offsets to the VTable pointer for class instance variables, and then just add inherited class instance variables before the superclass. Just a thought, mind you... ---- Robert P. Krajewski Internet: rpk@ai.mit.edu ; Lotus: robert_krajewski.lotus@crd.dnet.lotus.com