mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 01:27:16 +08:00
Use Use templetized operations for Score and Value
Note that in value we leave two specialized functions to allow adding an integer, we don't want to add this as a template becasue we want to control implicit conversions to integer of an enum. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -137,6 +137,9 @@ inline void operator-- (T& d, int) { d = T(int(d) - 1); }
|
||||
template<typename T>
|
||||
inline void operator+= (T& d1, const T d2) { d1 = d1 + d2; }
|
||||
|
||||
template<typename T>
|
||||
inline void operator-= (T& d1, const T d2) { d1 = d1 - d2; }
|
||||
|
||||
template<typename T>
|
||||
inline void operator*= (T& d, int i) { d = T(int(d) * i); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user