mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 09:37:16 +08:00
Use templetized operations for Square
This is tricky because there are some special binary fnctions with SquareDelta that we should leave as they are. Also note that we needed to add Unary minus template to fix a comile error in SERIALIZE_MOVES_D macro that was triggered because now we don't allow conversion to int. No fuctional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -125,6 +125,9 @@ inline T operator* (int i, const T d) { return T(int(d) * i); }
|
||||
template<typename T>
|
||||
inline T operator/ (const T d, int i) { return T(int(d) / i); }
|
||||
|
||||
template<typename T>
|
||||
inline T operator- (const T d) { return T(-int(d)); }
|
||||
|
||||
template<typename T>
|
||||
inline void operator++ (T& d, int) { d = T(int(d) + 1); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user