Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Off-Topic: How is try/catch and RTTI implemented?

Author: Dan Newman

Date: 04:02:01 08/20/00

Go up one level in this thread


On August 19, 2000 at 00:39:38, Dave Gomboc wrote:

>On August 18, 2000 at 18:14:05, Dan Newman wrote:
>
>>I haven't ever tried RTTI and can't really see where it would be useful in a
>>chess program since we generally know the types of all our objects.  OTOH, I
>>guess you could make each piece an object of a different type and when scanning
>>the board use RTTI to identify it.  Bleah.  (I'm really not sure why
>>it was added to the language since you can easily do it yourself with what
>>language elements were already available...)
>
>Your scenario would be adequaely handled by virtual dispatch -- there's no need
>to use RTTI.  Bleah, indeed! :-)
>
>Why was it added to the language?  Because everybody was writing their own,
>incompatible versions of it (big fun when using multiple third-party libraries),
>and once exception handling support was included in the language, most of what
>was needed for RTTI had to be there anyway.
>

I hadn't thought of that.  I guess you really need some sort of (hidden)
RTTI to allow catch blocks to identify what type the incoming exception
objects have...  Interesting.

-Dan.

>Dave



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.