Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!rutgers!bellcore!rruxh!aaron From: aaron@rruxh.UUCP (Akman) Newsgroups: comp.lang.c++ Subject: CastDown vs. Virtuals Message-ID: Date: 8 Jun 90 16:52:24 GMT Sender: news@bellcore.bellcore.com Distribution: comp Organization: Bellcore Lines: 34 I keep seeing notes about C++'s inability to do CastDowns from the base class to the derived class. Can someone explain the case(s) where virtual functions in the base class are insufficient (I am trying to follow the discussion, but it still seems to me that they're sufficient). What I mean by virtual functions in the base class is: class animal { // biology... public: // ... virtual int walk() { cout < "not defined\n"; } virtual int make_my_noise() { cout < "not defined\n"; } // ... }; class dog : animal { // dog biology... public: // ... int walk() { cout << "all fours, tail wagging\n"; } int make_my_noise { cout << "woof woof\n"; } }; As long as there is a generic base class that describes the mutual properties of all possible derived classes, that should be sufficient (and object oriented). Yes? No? -- ----------- Aaron Akman, 201-699-8019, bellcore!rruxh!aaron, RRC 4D-728