home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!news.centerline.com!noc.near.net!hri.com!spool.mu.edu!olivea!charnel!sifon!thunder.mcrcim.mcgill.edu!sobeco!philmtl!vedge!hendrik
- From: hendrik@vedge.com (Hendrik Boom)
- Newsgroups: comp.std.c++
- Subject: Re: pointer comparisons
- Message-ID: <1993Jan20.173927.3061@vedge.com>
- Date: 20 Jan 93 17:39:27 GMT
- References: <1993Jan18.182452.15390@lpi.liant.com>
- Organization: Visual Edge Software Ltd.
- Lines: 23
-
- pkt@lpi.liant.com (Scott Turner) writes:
- : In article <1393@pivot-sts.sbi.com>, linke@kirin (User - Bill Linke) writes:
- : > In article <1993Jan11.190959.5305@lpi.liant.com>, pkt@lpi.liant.com (Scott Turner) writes:
- : > > If we have objects of a type which requires no state, e.g.
- : > > struct B{} a, b;
- : > > then in order for them to have distinct identities an implementation
- : > > might allocate addresses that don't point to valid memory. Again, no
- : > > storage is required.
-
- (Not quite a quote -- I named the struct 'B' so I could talk about it.)
- There's no problem with allocating no storage for struct B, and using
- addresses into deep space or real space to point to B's. Even if user code
- dereferences it or copies it this can be done with no action.
- But it nonempty class C inherits from B, you have trouble comparing
- pointers to B with pointers to C that have been converted to B,
- unless you are careful that addresses of B's are outside of usable
- memory.
- :
- --
- -------------------------------------------------------
- Try one or more of the following addresses to reply.
- at work: hendrik@vedge.com, iros1!vedge!hendrik
- at home: uunet!ozrout!topoi!hendrik
-