Computer Chess Club Archives


Search

Terms

Messages

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

Author: Tord Romstad

Date: 07:34:22 08/10/04

Go up one level in this thread


On August 10, 2004 at 09:42:21, Gerd Isenberg wrote:

>May be a matter of taste or addiction - C-Style versus C++ style.
>
>In isSliding(piece) the function may be in some global namespace and if "piece"
>and "square" are both enum types the compiler is not able to distinguish between
>isSliding(piece) and isSliding(square).
>
>If you restrict the function scope to classes, piece.isSliding() is fine while
>square.isSliding() produces an error.

You definitely have a point regarding the namespace issue.  I didn't think
about that.

Personally I detest the Simula-style object.function(...) syntax for methods,
but that is of course just a matter of taste.

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.