diff options
Diffstat (limited to 'src/common/bit_field.h')
-rw-r--r-- | src/common/bit_field.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/common/bit_field.h b/src/common/bit_field.h index b5977ee56..c38a3fb08 100644 --- a/src/common/bit_field.h +++ b/src/common/bit_field.h @@ -142,7 +142,7 @@ public: __forceinline BitField& operator=(T val) { - storage = (storage & ~GetMask()) | (((StorageType)val << position) & GetMask()); + Assign(val); return *this; } @@ -151,6 +151,10 @@ public: return Value(); } + __forceinline void Assign(const T& value) { + storage = (storage & ~GetMask()) | (((StorageType)value << position) & GetMask()); + } + __forceinline T Value() const { if (std::numeric_limits<T>::is_signed) |