Computer Chess Club Archives


Search

Terms

Messages

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

Author: Dave Gomboc

Date: 21:39:38 08/18/00

Go up one level in this thread


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.

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.