BitField: Get rid of a C-style cast

This can simply be the max value of the unsigned type.
This commit is contained in:
Lioncash 2017-03-23 11:01:39 -04:00
parent e43c495ce5
commit b711daee5f
1 changed files with 1 additions and 1 deletions

View File

@ -165,7 +165,7 @@ private:
static constexpr StorageType GetMask()
{
return (((StorageTypeU)~0) >> (8 * sizeof(T) - bits)) << position;
return (std::numeric_limits<StorageTypeU>::max() >> (8 * sizeof(T) - bits)) << position;
}
StorageType storage;