]> git.sesse.net Git - stockfish/commit
Use polymorphism to resolve map() overloading
authorMarco Costalba <mcostalba@gmail.com>
Sun, 1 Apr 2012 14:12:39 +0000 (15:12 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 1 Apr 2012 15:16:51 +0000 (16:16 +0100)
commitdda0fa1a43e1096415ff8f83dd14e6322f1a8e68
tree40c2b360bbe252c029c5b3d251b5712f4e5ca331
parent7eb6a488ade31254151fd516aa4c94fc56b84a1f
Use polymorphism to resolve map() overloading

The 2 overload functions map() accept a pointer to
EndgameBase<Value> or a pointer to EndgameBase<ScaleFactor>.

Because Endgame<E> is derived from one of them we can
directly use a pointer to this class to resolve the
overload as is needed in Endgames::add().

Also made class Endgames fully parametrized and no more
hardcoded to the types (Value or ScaleFactor) of endgames
stored.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/endgame.cpp
src/endgame.h