home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c++:11743 comp.std.c++:990
- Newsgroups: comp.lang.c++,comp.std.c++
- Path: sparky!uunet!ftpbox!motsrd!news
- From: shang@corp.mot.com (David (Lujun) Shang)
- Subject: Re: Downcasting and mortal sin (was run-time type checking)
- Message-ID: <1992Jul29.164343.21959@cadsun.corp.mot.com>
- Sender: news@cadsun.corp.mot.com
- Reply-To: shang@corp.mot.com
- Organization: Motorola, Inc., Software Research and Development, Rolling Meadows, IL. 60008
- References: <2A75806A.826A@tct.com>
- Date: Wed, 29 Jul 92 16:43:43 GMT
- Lines: 17
-
- In article <2A75806A.826A@tct.com> chip@tct.com (Chip Salzenberg) writes:
-
- > Therefore you need this:
- >
- > virtual boolean Animal::can_mate_with(const Animal&);
- >
-
- I'm interested in the implementation of your "can_mate_with" in a derived
- class. Whould you show me how it is done without RTTI? Two conventions:
-
- (1) Do not supply your own RTTI through virtual functions.
- (2) Do not flood virtual functions in the base for each possible derived
- classes.
-
- Okay?
-
- David Shang
-