Bitfield: Cast value to storage type in assignment operator

This allows us to use enum classes in bitfields.
This commit is contained in:
Stenzek 2017-09-07 23:00:12 +10:00
parent 9d169449a7
commit 4d36f0cc87

View File

@ -136,7 +136,7 @@ public:
__forceinline BitField& operator=(T val)
{
storage = (storage & ~GetMask()) | ((val << position) & GetMask());
storage = (storage & ~GetMask()) | ((static_cast<StorageType>(val) << position) & GetMask());
return *this;
}