RFC: New C++ Attribute: final
Nathan Sidwell
nathan@codesourcery.com
Tue Mar 2 10:01:00 GMT 2004
Joe Buck wrote:
> On Mon, Mar 01, 2004 at 03:04:40PM +0000, Nathan Sidwell wrote:
>
>>Jeff Sturm wrote:
>>
>>>On Mon, 1 Mar 2004, Nathan Sidwell wrote:
>>>
>>>
>>>>Kevin Atkinson wrote:
>>>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?
>>
>>Only when the dynamic type can be determined at compile time.
>
>
> What you are missing (or not paying enough attention to) is that the
> dynamic type does not need to be determined exactly.
Joe, that question was about C++, not about 'C++ with final'. I wanted
to get a handle on whether 'final' had more to it than the virtual
dispatch optimization we are both talking about. You've provided
plenty of examples where final would be useful in both efficiency and
language expressibility domains, that is good, thank you.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
More information about the Gcc
mailing list