473,473 Members | 4,176 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

virtual ~type_info();

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.
Jul 22 '05 #1
3 1483
"Bobo" <pi***@correo.nu> 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
Jul 22 '05 #2
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.
Jul 22 '05 #3
"VANNA CHHUM" <eu*********@verizon.net> wrote in message news:<Vq*****************@nwrddc02.gnilink.net>...
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 :-)
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

54
by: sks_cpp | last post by:
What is a type_info function, more particularly, what is a type_info node? Are these related to the vtable by any means? I have seen linker errors such as: "undefined reference to SomeClass...
5
by: skscpp | last post by:
I "think" I understand why a virtual table needs to be constructed when polymorphic classes are being compiled. Now, I also know what a type_info function and type_info node are although I am...
10
by: Martin Vorbrodt | last post by:
Example code in one of my books intrigues me: class B { public: B* Clone() const { B* p = DoClone(); assert(typeid(*p) == typeid(*this)); return p; }
1
by: tham | last post by:
hi, with RTTI turned on... can i keep the reference to the type_info so that i can pass it around? i want to pass something to a function that will pick out a specific type of object from a pool...
11
by: Matthias | last post by:
Hello, templated virtual member functions are not allowed. Now I am searching for a good workaround for this problem, but I can't find any. Here's my problem: class Base { template...
1
by: jahhaj | last post by:
Lots of people seem to have problems with these, here's my particular variation. I'm using a third partly library which I believe was compiled with VC 7.1. I'm using the free version of VC 8 and...
9
by: Rahul | last post by:
Hi Everyone, I was working with Run Time Type Information and with typeid operator, and so on i tried to create an object of type_info class and i'm not able to do so, because of the class...
2
by: sumsin | last post by:
What is type_info object?
11
by: Gabriel de Dietrich | last post by:
Hi all! Just out of curiosity: Is there any way to get the address of a particular virtual member function given an object? Some code to make things more clear... class A { public: A() { }
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.