home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.std.c++
- Path: sparky!uunet!titan!lpi!pkt
- From: pkt@lpi.liant.com (Scott Turner)
- Subject: Re: pointer comparisons
- Message-ID: <1993Jan11.192337.5368@lpi.liant.com>
- Sender: pkt@lpi (Scott Turner)
- Organization: Liant Software Corporation
- References: <1993Jan4.200625.5680@lucid.com> <9300812.4038@mulga.cs.mu.OZ.AU> <1993Jan8.150113.1643@lpi.liant.com> <1993Jan8.181100.10727@ucc.su.OZ.AU>
- Date: Mon, 11 Jan 1993 19:23:37 GMT
- Lines: 50
-
- In article <1993Jan8.181100.10727@ucc.su.OZ.AU>, maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
- > In article <1993Jan8.150113.1643@lpi.liant.com> pkt@lpi.liant.com (Scott Turner) writes:
- > >> maxtal> Corollary: such objects have states not accessible via
- > >> maxtal> the contiguous storage allocated for them.
- > >> maxtal> (via virtual function calls)
- > >>
- > >Since John MAX Skaller was drawing inferences from my belief that base
- > >class subobjects are objects, I want to go on record. I agree that
- > >"abstract objects" can exist, but the corollary does not follow.
- >
- > Well, you can have a pointer to another object in an object,
- > and access the other object via the pointer, right?
- >
- > But this doesn't count :-) The pointer is part
- > of the state of the object, and thus so is the object pointed
- > to (and so on recursively)
- >
- > In any case, I will fill in the hole:
- >
- > class X {
- > public:
- > virtual int f()=0;
- > };
- >
- > class Y : public X {
- > int i;
- > public:
- > int f() {return i;}
- > void setint(int j) {i=j;}
- > };
- >
- > In this single example, the abstract subobject X in Y has
- > public states of measure 'int'. (There are 'int' values).
- > Yet X has private storage of measure zero.
- >
- > Where is the hole in this argument? Answer: X has a vtble
- > pointer!
-
- Yes, that's close to the way I look at it. X declares a virtual function f
- with the consequence that any subobject of type X includes
- some indication of how f has been overridden in constructing the enclosing
- object. f may refer to non-contiguous storage, but that's no more
- problematic than if X had a pointer member which refers to non-contiguous
- storage.
- --
- Prescott K. Turner, Jr.
- Liant Software Corp. (developers of LPI languages)
- 959 Concord St., Framingham, MA 01701 USA (508) 872-8700
- UUCP: uunet!lpi!pkt Internet: pkt@lpi.liant.com
-
-