Path: news.daimi.aau.dk!news.uni-c.dk!sunic!trane.uninett.no!eunet.no!nuug!EU.net!uunet!MathWorks.Com!europa.eng.gtefsd.com!swiss.ans.net!news.dfn.de!news.belwue.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!news.rz.uni-karlsruhe.de!hf From: hf@informatik.uni-karlsruhe.de (Harald Fuchs) Newsgroups: comp.lang.beta Subject: Re: unsafe virtual patterns? Date: 21 Sep 1994 15:18:09 GMT Organization: Telematics Dept., Karlsruhe University, Germany Lines: 9 Message-ID: References: <35nlra$t2@rosie.next.com> <35nubg$74o@engnews2.Eng.Sun.COM> Reply-To: hf@tk.telematik.informatik.uni-karlsruhe.de NNTP-Posting-Host: faustino.telematik.informatik.uni-karlsruhe.de Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit In-reply-to: olm@Eng.Sun.COM's message of 21 Sep 1994 00:22:08 GMT hf/ X-PGP-Public-Key: finger -l hf@tk.telematik.informatik.uni-karlsruhe.de X-PGP-Fingerprint: 09 4E C4 A2 B2 C5 33 1A 79 80 5D 39 BD 9B 89 39 kiz#%J_T\[o"W6$r~=>bUG3}]662E7^t)&e'X!i<80mK`#8_COdRHrEG'[sT i Simula has the run-time check for reverse assignments. > In Eiffel it corresponds to aBus?=aVehicle > and for C++ it is the repsonsibility of the programmer (correct me if > I am wrong!) Yes and no. A recent addition to C++ is the "dynamic_cast" operator which does roughly the same as "?=" in Eiffel. The difference is that it won't work for non-polymorphic objects, i.e. objects without virtual member functions.