By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,581 Members | 993 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,581 IT Pros & Developers. It's quick & easy.

Virual Functions mechanism

P: n/a
Ram
Hi,

Please clarify my below mentioned doubts,

1. Virtual functions addresses are stored in Virtual table, but how about
the Virtual destructor?

2. Is the Virtual destructor also treated as just like any other function
except the calling mechanism?

3. Could you please refer me a book/Website where I can find the detailed
information about the Virtual function and internal details.? What happens
at the compile time and Run time in detail?

Thanks & Regards,

Ram
Oct 17 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
* Ram:
Hi,

Please clarify my below mentioned doubts,

1. Virtual functions addresses are stored in Virtual table,
Are they?

but how about the Virtual destructor?
Usually treated in exactly the same way as other virtual functions.

2. Is the Virtual destructor also treated as just like any other function
except the calling mechanism?
No.

3. Could you please refer me a book/Website where I can find the detailed
information about the Virtual function and internal details.? What happens
at the compile time and Run time in detail?
See <url: http://home.no.net/dubjai/win32cpptut/special/pointers/ch_01.pdf>.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Oct 17 '06 #2

P: n/a
"Ram" <ra******@yahoo.comwrites:

All of this is implementation dependent, though as far as I know they
don't vary too much as far as you're questions are concerned.
1. Virtual functions addresses are stored in Virtual table, but how about
the Virtual destructor?
At least on my platform, there is technically more than one dtor, two
of them virtual, one of them not. Don't ask me why.
2. Is the Virtual destructor also treated as just like any other function
except the calling mechanism?
As little as ctors are normal non-virtual functions.
3. Could you please refer me a book/Website where I can find the detailed
information about the Virtual function and internal details.? What happens
at the compile time and Run time in detail?
One unfortunately very outdated and also somewhat superficial book
which is often cited when such questions come up is `Inside the C++
object model'.

I would nevertheless suggest it as a starting point, if you have
access to it.

Since it's platform dependent, you might find it documented for your
platform. For example, gcc adheres to the Itanium C++ ABI (google for
itanium and abi), even on systems other than Itanium, and Linux
systems are required that their compiler do so by LSB.

This document is a bit difficult to understand if you're not familiar
with the basics though (admittedly I don't understand too much).

It's still useful to realise _how_ complex matters are.

--
Cheers, Jens
Oct 17 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.