X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftypes.h;h=ec9f9bb97f3a9a688bc6cd5d077579c9ffe3ea07;hp=4931531b54a87f37e70628c035158c91b9642c8e;hb=8e31764c49149cd73cdbfd8a251bb31f068bf799;hpb=80bee85d5f48cc1e06f16236a73c86a14c1d0756 diff --git a/src/types.h b/src/types.h index 4931531b..ec9f9bb9 100644 --- a/src/types.h +++ b/src/types.h @@ -125,6 +125,15 @@ inline T operator* (int i, const T d) { return T(int(d) * i); } template inline T operator/ (const T d, int i) { return T(int(d) / i); } +template +inline T operator- (const T d) { return T(-int(d)); } + +template +inline void operator++ (T& d, int) { d = T(int(d) + 1); } + +template +inline void operator-- (T& d, int) { d = T(int(d) - 1); } + template inline void operator+= (T& d1, const T d2) { d1 = d1 + d2; }