S
siddhu
Like other virtual functions does the entry of virtual destructor exist
in VTABLE?
in VTABLE?
siddhu said:Like other virtual functions does the entry of virtual destructor exist
in VTABLE?
siddhu said:Like other virtual functions does the entry of virtual destructor exist
in VTABLE?
In general, it's implementation dependent since there is no guarantee
that there is a vtable. Compilers can use other techniques to implement
virtual dispatching (though I don't know of any that do). See this FAQ:
He said: "(though I don't know of any that do)"
JustBoo said:Hmm... let's think about that for awhile shall we. Yeah... just what I
thought.
From the Boost homepage:
"We aim to establish "existing practice" and provide reference
implementations so that Boost libraries are suitable for eventual
standardization. Ten Boost libraries are already included in the C++
Standards Committee's Library Technical Report ( TR1) as a step
toward becoming part of a future C++ Standard. More Boost libraries
are proposed for the upcoming TR2."
So many Boost features are NOT actually IN the C++ Standard.
Is that correct?
From V. Bazarov below:
"The Standard does not require it, so it is not really a C++ l
anguage feature, it's just an implementation detail."
Therefore, discussing Boost features NOT in the Standard is
forbidden in this ng, CORRECT?
I look forward to the Language Lawyers and Net Cops (notice I didn't
say engineers) expelling the horrendous offenders that populate this
ng.
> Thank you for defending us against the horde.
JustBoo said:I'm curious: Please name one *current* C++ compiler that does not use
vtables. Just asking.
Actually, I think you would be hard pressed to find any *current* C++
compiler which implements virtual functions as calling a function from
some table like the original CFront compiler did: the CFront virtual
function table is the what I would consider a vtable. Modern C++
implementations typically use things called "thunks" which e.g. do
appropriate pointer adjustments before effectively calling into a
a function looked up by the thunk. The key difference here is that
you could simply call a function obtained from a vtable using the
'this' pointer in CFront's implementations. You cannot do anything
like this with the data looked up by a thunk because you would first
need to adjust the position the 'this' pointer points to.
That is, while you could in principle (if there were an accessible
member called '_Vtable' to access the virtual function table) use
(obj->_Vtable[idx])(obj)
to call a virtual function without arguments using a vtable, you
cannot do anything like this with thunks. Also note that there are
different approaches to thunks: these could be small functions which
are really generated or the necessary operations could be applied
inline.
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.