Re: RTTI

Discussion in 'C++' started by John Harrison, Jul 14, 2003.

  1. "alg" <> wrote in message
    news:ZPrQa.53778$...
    > 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
    John Harrison, Jul 14, 2003
    #1
    1. Advertising

  2. John Harrison

    Ron Natalie Guest

    "John Harrison" <> wrote in message news:03sQa.11198$...

    >
    > 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).).
    Ron Natalie, Jul 14, 2003
    #2
    1. Advertising

  3. "Ron Natalie" <> wrote in message
    news:3f12ae38$0$24587$...
    >
    > "John Harrison" <> wrote in message

    news:03sQa.11198$...
    >
    > >
    > > 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
    John Harrison, Jul 14, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alf P. Steinbach

    Re: RTTI

    Alf P. Steinbach, Jul 14, 2003, in forum: C++
    Replies:
    0
    Views:
    463
    Alf P. Steinbach
    Jul 14, 2003
  2. Steven Lien

    About RTTI

    Steven Lien, Aug 19, 2003, in forum: C++
    Replies:
    4
    Views:
    595
    Ivan Vecerina
    Aug 19, 2003
  3. BillyO
    Replies:
    2
    Views:
    488
    dslater
    Sep 30, 2003
  4. tirath
    Replies:
    3
    Views:
    706
    Ivan Vecerina
    Oct 12, 2003
  5. MoCha

    using rtti

    MoCha, Nov 26, 2003, in forum: C++
    Replies:
    1
    Views:
    378
    Ivan Vecerina
    Nov 26, 2003
Loading...

Share This Page