Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: OOP - Is this possible?

Author: Tom Kerrigan

Date: 12:28:15 03/27/02

Go up one level in this thread


On March 27, 2002 at 15:21:51, Sune Fischer wrote:

>But actually, the 'this' pointer is implied, the complier _know_ it is there and
>it knows the specific object on which function is working.
>In C, you have to use the indirection operator '->' all the time.

The way C++ compilers work is to pass a hidden "this" argument to member
functions. The indirection you mention is being done exactly the same way as it
would be in C, it's just syntactically implied by the language. That's why
moving "normal" functions (no this pointer) to member functions gives you a
performance hit.

-Tom



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

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