Path: utzoo!attcan!uunet!ogicse!decwrl!nsc!voder!procase!roger From: roger@procase.UUCP (Roger H. Scott) Newsgroups: comp.lang.c++ Subject: Re: virtual static data? Message-ID: <154@logo.procase.UUCP> Date: 26 May 90 07:44:15 GMT References: <1990May23.102905.8689@athena.mit.edu> <13757@csli.Stanford.EDU> <54856@microsoft.UUCP> Reply-To: roger@procase.UUCP (Roger H. Scott) Organization: proCASE Corporation, Santa Clara, CA Lines: 14 In article <54856@microsoft.UUCP> jimad@microsoft.UUCP (Jim ADCOCK) writes: >... >The implied complaint being that virtual functions are slower than virtual >static data members? -- This need not be the case. Or are you worried about >typing pfoo->classname(); verses pfoo->classname; ??? Speed is *an* issue, but not *the* major issue. Virtual static data members require only space enough for a slot in the vtbls plus the space for the data itself in those classes that redefine the data; a virtual function returning the same value requires a vtbl slot, the space for the data, *plus* the space for the code for the function (small, but positive). It is also inconvenient to have to define both the function and the data when all I want is the data. Lastly, virtual data is appealing to people like me who think orthogonality is a GOOD THING in a language.