X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fendgame.h;h=cd05f0cd1b6273cfa91341d379bc36439d3271d5;hp=453d8b29d47d98780fb8a04bb00da8efed95ff8c;hb=e53774bc49dd0aaa1c129ee98c09e1a56ef974fb;hpb=f7d8ea3866c26df10617e97513e906d1f5a5b833 diff --git a/src/endgame.h b/src/endgame.h index 453d8b29..cd05f0cd 100644 --- a/src/endgame.h +++ b/src/endgame.h @@ -67,8 +67,8 @@ enum EndgameType { /// Endgame functions can be of two types depending on whether they return a /// Value or a ScaleFactor. -template -using eg_fun = std::conditional<(E < SCALING_FUNCTIONS), Value, ScaleFactor>; +template using +eg_type = typename std::conditional<(E < SCALING_FUNCTIONS), Value, ScaleFactor>::type; /// Base and derived templates for endgame evaluation and scaling functions @@ -82,7 +82,7 @@ struct EndgameBase { }; -template::type> +template> struct Endgame : public EndgameBase { explicit Endgame(Color c) : strongSide(c), weakSide(~c) {} @@ -90,7 +90,7 @@ struct Endgame : public EndgameBase { T operator()(const Position&) const; private: - const Color strongSide, weakSide; + Color strongSide, weakSide; }; @@ -100,21 +100,25 @@ private: class Endgames { - template using Map = std::map>; + template using Map = std::map>>; - template::type>> + template> void add(const std::string& code); - template>::value> - Map& map() { return std::get(maps); } + template + Map& map() { + return std::get::value>(maps); + } - std::pair>, Map>> maps; + std::pair, Map> maps; public: Endgames(); - template> E* probe(Key key) - { return map().count(key) ? map()[key].get() : nullptr; } + template + EndgameBase* probe(Key key) { + return map().count(key) ? map()[key].get() : nullptr; + } }; #endif // #ifndef ENDGAME_H_INCLUDED