Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: C and C++ --- NPS

Author: Dave Gomboc

Date: 12:56:19 12/25/02

Go up one level in this thread


On December 25, 2002 at 15:38:19, Matt Taylor wrote:

>>Overloading costs nothing, it's a compile time construct and is resolved at
>>compile/link time.
>>Inheritance costs nothing, it too is a compile/link time issue.
>>You know nothing about C++, do you? I didn't think so.
>
>Overloading costs an indirect function call. I'm not sure if you can apply const
>to a class like you can apply final to one in Java, but unless the compiler
>knows the class can't be inherited from, it has to make the operator an indirect
>function call.

Calling a class const in C++ means something else, but a C++ compiler can (and
some do) figure out which classes are at the bottom of the inheritance hierarchy
at compile-time.  (Unlike with Java, this isn't mutable at run-time.)

Dave



This page took 0.01 seconds to execute

Last modified: Thu, 07 Jul 11 08:48:38 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.