virtual ~type_info();

B

Bobo

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.
 
V

Victor Bazarov

Bobo said:
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
 
V

VANNA CHHUM

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.
 
B

Bobo

VANNA CHHUM said:
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 :)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top