Inherent code performance advantages of D over C?

Stewart Gordon smjg_1998 at yahoo.com
Sat Feb 1 06:58:33 PST 2014


On 07/12/2013 17:29, Walter Bright wrote:
> On 12/7/2013 1:52 AM, Joseph Rushton Wakeling wrote:
>> On 07/12/13 02:10, Walter Bright wrote:
>>> I know well that people used to C++ will likely do this. However, one can get in
>>> the habit of by default adding "final:" as the first line in a class definition,
>>> and then the compiler will tell you which ones need to be made virtual.
>>
>> The disadvantage of this approach is that, if one forgets to add that "final",
>> it doesn't just produce a performance hit -- it means that it may be impossible
>> to correct without breaking downstream code, because users may have overridden
>> class methods that weren't meant to be virtual.
>
> D doesn't allow overriding non-virtual functions (unlike C++).

How do you _override_ a non-virtual function in C++, as opposed to define an independent 
function with the same name in a derived class?

Stewart.

-- 
My email address is valid but not my primary mailbox and not checked regularly.  Please 
keep replies on the 'group where everybody may benefit.


More information about the Digitalmars-d mailing list