This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: New C++ Attribute: final


Jeff Sturm <jsturm@one-point.com> writes:

| If a base class declares a method 'virtual' in C++, can a derived class
| override the modifier, such that calls to the overridden method do
| not require vtable dispatch?

It depends on the compiler and how you organize your program.  Defunct
KCC was able to use type information from your program, do static
analyzis and optimize out vcalls.  But you can fool it, though, if
you're determined.  Note also that if you have a good linker, it can
determine most of the cases when a virtual function is not overriden
and optimize the vcall.

"final" is probably one of the most recurent keywords people want to
borrow from other programming languages and add to C++.  MS is recently
recycling it as "sealed".  The next recurent keyword probably is
"override".

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]