Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Ambiguous moves in algebraic notation

Author: Russell Reagan

Date: 11:15:30 06/30/02

Go up one level in this thread


On June 30, 2002 at 08:45:51, Daniel Clausen wrote:

>I assume that you have a header-file Move.h which contains a
>prototype/declaration for the method toString. Therefore this header file has to
>include Position.h (assuming this thing is in its appropriate header file - many
>people prefer to have a Types.h or Common.h for often-used data-structures)

I have separate files for each of my classes in one version of my program. In
another everything is just in one file. I'm developing several versions of my
program using different approaches.

>Now at every place where you include 'Move.h', you indirectly also include
>'Position.h', which can cause circular includes later. Sometimes this is not a
>problem (although it's not really good from a design POV), and sometimes it
>causes problems and you have to resolve these with forward declaration.

In my header files I just add

#ifndef move_h
#define move_h

// code here

#endif

and it works fine.

Russell



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.