X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fendgame.h;h=cd05f0cd1b6273cfa91341d379bc36439d3271d5;hp=392788cfe9fbdc12373ce304cdcf45f748172caf;hb=60c121f3b1ee7d5ced3435cc1718e4e6e6fd8383;hpb=ca3622f8e86746b066f75db449b1e8beac111b6c diff --git a/src/endgame.h b/src/endgame.h index 392788cf..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) {} @@ -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