Path: utzoo!attcan!uunet!ginosko!uakari.primate.wisc.edu!ctrsol!cica!iuvax!rutgers!att!cbnewsl!dog
From: dog@cbnewsl.ATT.COM (edward.n.schiebel)
Newsgroups: comp.lang.c++
Subject: Re: ->* and type info for virtual functions
Message-ID: <2016@cbnewsl.ATT.COM>
Date: 27 Sep 89 11:49:42 GMT
References: <536@atcmpe.atcmp.nl>
Organization: AT&T Bell Laboratories
Lines: 17

From article <536@atcmpe.atcmp.nl>, by leo@atcmp.nl (Leo  Willems):
> In the following program a class object its address is put in to a void pointer.
> After restoring this pointer into a pointer of the base class, typeinfo seems to
> be restored:

This will not necessarily be the case, and definitely not with 
multiple inheritence.  

When a derived object is being passed around as a pointer to a one of 
its base classes, that pointer's value is not necessarily == to the 
address of the derived object.  If you take the base*, 
cast it to a void*, then cast it back to a derived*, 
you will definitly have problems ( I have been bitten by this :-).

	Ed Schiebel
	AT&T Bell Laboratories
	dog@vilya.att.com