From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17567 invoked by alias); 1 Mar 2004 15:02:25 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 17560 invoked from network); 1 Mar 2004 15:02:24 -0000 Received: from unknown (HELO uniton.integrable-solutions.net) (62.212.99.186) by sources.redhat.com with SMTP; 1 Mar 2004 15:02:24 -0000 Received: from uniton.integrable-solutions.net (localhost [127.0.0.1]) by uniton.integrable-solutions.net (8.12.3/8.12.3/SuSE Linux 0.6) with ESMTP id i21Eqq9b014211; Mon, 1 Mar 2004 15:52:52 +0100 Received: (from gdr@localhost) by uniton.integrable-solutions.net (8.12.3/8.12.3/Submit) id i21Eqp81014210; Mon, 1 Mar 2004 15:52:51 +0100 X-Authentication-Warning: uniton.integrable-solutions.net: gdr set sender to gdr@integrable-solutions.net using -f To: Jeff Sturm Cc: Nathan Sidwell , Kevin Atkinson , Mark Mielke , Subject: Re: RFC: New C++ Attribute: final References: From: Gabriel Dos Reis In-Reply-To: Organization: Integrable Solutions Date: Mon, 01 Mar 2004 15:02:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-03/txt/msg00054.txt.bz2 Jeff Sturm 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