Path: utzoo!utgpu!watserv1!watmath!att!dptg!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.lang.c++ Subject: Re: polymorfism on objects, not pointers Keywords: polymorfism dynamic binding Message-ID: <11019@alice.UUCP> Date: 5 Jul 90 15:03:09 GMT References: <631@atcmpe.atcmp.nl> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 20 In article <631@atcmpe.atcmp.nl>, leo@atcmp.nl (Leo Willems) writes: > In the example below ::g() accepts a class B variable (not a pointer/reference) > If g() is called with a D (derived from B) the virtual mechanism works! > B bb; > D dd; > g(dd); //see end of posting for complete code > In C++ 1.2 this didn't work (compile time error: can not make a B from a D) > but in 2.0 it is possible to make a B from a D but as I understand it that > should not alter the B behaviour, and so no runtime binding is expected. It's a bug in C++ 2.0, fixed in 2.1 -- --Andrew Koenig ark@europa.att.com