Computer Chess Club Archives


Search

Terms

Messages

Subject: Colourspecific code (C++ and templates/traits)

Author: Daniel Clausen

Date: 14:30:03 11/26/03


Hi

Russell's post (http://www.talkchess.com/forums/1/message.html?330142) made me
think a little and I tried to make use of it in the following case:

class AttackTable
{
   public:
      static void init(void);  // Initializes all static arrays

      static uint64_t whitePawnAT[64];
      static uint64_t blackPawnAT[64];

      ...
};


Using templates/traits, I would like to replace the call

   uint64_t bb = AttackTable::whitePawnAT[42];

with something like

   uint64_t bb = AttackTable::ColorTraits<White>::pawnAT[42];

I tried a bit but the stuff didn't even compile. :) Ideas? Comments? Shrieking
epitaphs? Thanks!

Sargon

PS. I hope I don't overlook something stupid. If I do, my account got hacked and
this post is not really from me. :)



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.