virtual ~type_info();

Discussion in 'C++' started by Bobo, Jan 20, 2004.

  1. Bobo

    Bobo Guest

    Hello all.
    Can anybody explay WTH std::type_info has a virtual destructor?
    AFAIK the constructor is private so you cannot inherit from it (who
    would want, anyway?).

    TIA.
    Bobo.
     
    Bobo, Jan 20, 2004
    #1
    1. Advertising

  2. "Bobo" <> wrote...
    > Hello all.
    > Can anybody explay WTH std::type_info has a virtual destructor?
    > AFAIK the constructor is private so you cannot inherit from it (who
    > would want, anyway?).


    The implementation might need to. Besides, it helps a class to retain
    RTTI if at least one member function is virtual. Another thing: the
    private constructor prevents the users from constructing it, but some
    mechanism has to exist, no?

    Just a guess, of course. For better explanation ask in comp.std.c++.

    V
     
    Victor Bazarov, Jan 20, 2004
    #2
    1. Advertising

  3. Bobo

    VANNA CHHUM Guest

    That's an interesting question. I think you should post to
    comp.lang.c++.moderated or comp.std.c++. I'd like to know the answer to it
    as well.
     
    VANNA CHHUM, Jan 20, 2004
    #3
  4. Bobo

    Bobo Guest

    "VANNA CHHUM" <> wrote in message news:<VqgPb.4140$>...
    > That's an interesting question. I think you should post to
    > comp.lang.c++.moderated or comp.std.c++. I'd like to know the answer to it
    > as well.


    Ok. I'm moving :)
     
    Bobo, Jan 21, 2004
    #4
    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. sks_cpp

    type_info, vtable

    sks_cpp, Aug 19, 2003, in forum: C++
    Replies:
    54
    Views:
    2,257
    Ron Natalie
    Aug 27, 2003
  2. skscpp
    Replies:
    5
    Views:
    569
    EventHelix.com
    Nov 14, 2003
  3. =?ISO-8859-1?Q?Erik_Wikstr=F6m?=

    Storing std::type_info

    =?ISO-8859-1?Q?Erik_Wikstr=F6m?=, Aug 11, 2007, in forum: C++
    Replies:
    2
    Views:
    1,628
    Daniel Kraft
    Aug 11, 2007
  4. Rahul

    type_info

    Rahul, Dec 8, 2007, in forum: C++
    Replies:
    9
    Views:
    687
    James Kanze
    Dec 9, 2007
  5. sumsin

    What is type_info object?

    sumsin, Jun 11, 2008, in forum: C++
    Replies:
    1
    Views:
    416
    James Kanze
    Jun 12, 2008
Loading...

Share This Page