Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: what classes all the serious C++ chess programs have?

Author: Tord Romstad

Date: 05:28:53 08/10/04

Go up one level in this thread


On August 10, 2004 at 05:37:10, Gerd Isenberg wrote:

>Generic inline wrapper classes for pieces, moves, hashentries etc. are IMHO nice
>to hide implementation and to write "ugly" code once, without any performance
>penalty, some examples which same assembly output:
>
>   if (piece & 0x80) ...
>   if (piece & SLIDING_BIT) ...
>   if (isSlding(piece) ) ...
>   if (piece.isSliding()) ...
>or
>   if (hashentry.flags & 0x01) ...
>   if (hashentry.flags & LOWER_BOUND) ...
>   if (hashentry.isLowerBound() ) ...
>
>I prefere the latter.

I understand why you want to avoid the '&' variants, but why is
piece.isSliding() better than isSliding(piece), and hashentry.isLowerBound()
better than isLowerBound(hashentry)?

Tord



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.