diff --git a/include/gsl/gsl_byte b/include/gsl/gsl_byte index 6c05dd4..cd5a3fd 100644 --- a/include/gsl/gsl_byte +++ b/include/gsl/gsl_byte @@ -56,7 +56,7 @@ inline constexpr byte& operator<<=(byte& b, IntegerType shift) noexcept template ::value>> inline constexpr byte operator<<(byte b, IntegerType shift) noexcept { - return byte(static_cast(b) << shift); + return b <<= shift; } template ::value>> @@ -68,7 +68,7 @@ inline constexpr byte& operator>>=(byte& b, IntegerType shift) noexcept template ::value>> inline constexpr byte operator>>(byte b, IntegerType shift) noexcept { - return byte(static_cast(b) >> shift); + return b >>= shift; } inline constexpr byte& operator|=(byte& l, byte r) noexcept @@ -78,7 +78,7 @@ inline constexpr byte& operator|=(byte& l, byte r) noexcept inline constexpr byte operator|(byte l, byte r) noexcept { - return byte(static_cast(l) | static_cast(r)); + return l |= r; } inline constexpr byte& operator&=(byte& l, byte r) noexcept @@ -88,7 +88,7 @@ inline constexpr byte& operator&=(byte& l, byte r) noexcept inline constexpr byte operator&(byte l, byte r) noexcept { - return byte(static_cast(l) & static_cast(r)); + return l &= r; } inline constexpr byte& operator^=(byte& l, byte r) noexcept @@ -98,7 +98,7 @@ inline constexpr byte& operator^=(byte& l, byte r) noexcept inline constexpr byte operator^(byte l, byte r) noexcept { - return byte(static_cast(l) ^ static_cast(r)); + return l ^= r; } inline constexpr byte operator~(byte b) noexcept { return byte(~static_cast(b)); }