Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Re: RTTI

Reply
Thread Tools

Re: RTTI

 
 
John Harrison
Guest
Posts: n/a
 
      07-14-2003

"alg" <(E-Mail Removed)> wrote in message
news:ZPrQa.53778$(E-Mail Removed)...
> What're major content of RTTI? Does it just include static_cast<>,
> dynamic_cast<>, reinterpret_cast<> and const_cast<>? Is there other
> important things with it? Why is it an important part in C++ language?
>
> Thanks for your help!
>


dynamic_cast and also typeid and type_info. The other casts are not
evaluated at run time, so they aren't run time type identification.

I don't think they are an important part of C++. They were a late addition
to C++. But sometimes you do need to identify precisely what type an object
is (object persistance is the example often quoted) and occaisionally you do
need to do a cast from a base class to a derived class in a safe manner.

john



 
Reply With Quote
 
 
 
 
Ron Natalie
Guest
Posts: n/a
 
      07-14-2003

"John Harrison" <(E-Mail Removed)> wrote in message news:03sQa.11198$(E-Mail Removed)...

>
> I don't think they are an important part of C++. They were a late addition
> to C++.


RTTI is a very important concept. Neither concept was a particularly late
addition. dynamic_cast itself has been around for nearly ten years (it's
documented in the second edition of Stroustrup, which is now antiquated
beyond believe (published 1995).).


 
Reply With Quote
 
 
 
 
John Harrison
Guest
Posts: n/a
 
      07-14-2003

"Ron Natalie" <(E-Mail Removed)> wrote in message
news:3f12ae38$0$24587$(E-Mail Removed) m...
>
> "John Harrison" <(E-Mail Removed)> wrote in message

news:03sQa.11198$(E-Mail Removed)...
>
> >
> > I don't think they are an important part of C++. They were a late

addition
> > to C++.

>
> RTTI is a very important concept. Neither concept was a particularly

late
> addition. dynamic_cast itself has been around for nearly ten years (it's
> documented in the second edition of Stroustrup, which is now antiquated
> beyond believe (published 1995).).
>


Well, not in the first edition of Stroustrup would be my definition of a
late addition. FWIW I can't remember it being in the second eidtion either,
but I could easily be wrong.

john



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
using rtti MoCha C++ 1 11-26-2003 07:40 AM
[RTTI] cast base class pointer to <templated> derived class pointer tirath C++ 3 10-12-2003 01:44 PM
RTTI versus a base class enum to represent type BillyO C++ 2 09-30-2003 10:21 PM
About RTTI Steven Lien C++ 4 08-19-2003 06:03 PM
Re: RTTI Alf P. Steinbach C++ 0 07-14-2003 08:18 AM



Advertisments