X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftypes.h;h=543b38a84752faa6ab3844504e8ecd48d2aee381;hp=cbef89b7f4ca3659f673b15689171caf8ffca2ab;hb=bc83515c9e821016d2113298ef988e99ceced1af;hpb=8ab9c2511a36a929a17a689125c919c927aee786 diff --git a/src/types.h b/src/types.h index cbef89b7..543b38a8 100644 --- a/src/types.h +++ b/src/types.h @@ -254,6 +254,7 @@ enum Rank { RANK_1, RANK_2, RANK_3, RANK_4, RANK_5, RANK_6, RANK_7, RANK_8, RANK_NB }; +template inline T dist(T x, T y) { return x < y ? y - x : x - y; } /// The Score enum stores a middlegame and an endgame value in a single integer /// (enum). The least significant 16 bits are used to store the endgame value