diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:17:51 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:17:51 +0200 |
commit | 237aedc590b58c0e69d7dfcac92b5f767b7c004a (patch) | |
tree | 83f361a82ba483f2daf83b677e8685cd953812d9 /zen/int64.h | |
parent | 4.5 (diff) | |
download | FreeFileSync-237aedc590b58c0e69d7dfcac92b5f767b7c004a.tar.gz FreeFileSync-237aedc590b58c0e69d7dfcac92b5f767b7c004a.tar.bz2 FreeFileSync-237aedc590b58c0e69d7dfcac92b5f767b7c004a.zip |
4.6
Diffstat (limited to 'zen/int64.h')
-rw-r--r-- | zen/int64.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/zen/int64.h b/zen/int64.h index 91e24437..31c278ca 100644 --- a/zen/int64.h +++ b/zen/int64.h @@ -33,7 +33,8 @@ zen::Int64/zen::UInt64: wrapper classes around std::int64_t/std::uint64_t namespace zen { -template <class T, class U> inline void checkRange(U value) +template <class T, class U> inline +void checkRange(U value) { //caveat: std::numeric_limits<T>::min returns minimum positive(!) number for T = double, while behaving correctly for integer types... sigh assert(double(std::numeric_limits<T>::lowest()) <= double(value) && //new with C++11! @@ -93,6 +94,7 @@ public: Int64& operator|=(const Int64& rhs) { value |= rhs.value; return *this;} Int64& operator<<=(int rhs) { assert(rhs < 0 || (value << rhs) >> rhs == value); value <<= rhs; return *this; } Int64& operator>>=(int rhs) { assert(rhs > 0 || (value >> rhs) << rhs == value); value >>= rhs; return *this; } + Int64 operator-() const { return -value; } inline friend bool operator==(const Int64& lhs, const Int64& rhs) { return lhs.value == rhs.value; } inline friend bool operator!=(const Int64& lhs, const Int64& rhs) { return lhs.value != rhs.value; } |