[support.types.byteops] (original) (raw)

17 Language support library [support]

17.2 Common definitions [support.types]

17.2.5 byte type operations [support.types.byteops]

template<class IntType> constexpr byte& operator<<=(byte& b, IntType shift) noexcept;

Constraints: is_­integral_­v<IntType> is true.

Effects:Equivalent to:return b = b << shift;

template<class IntType> constexpr byte operator<<(byte b, IntType shift) noexcept;

Constraints: is_­integral_­v<IntType> is true.

Effects:Equivalent to:

return static_cast(static_cast(b) << shift);

template<class IntType> constexpr byte& operator>>=(byte& b, IntType shift) noexcept;

Constraints: is_­integral_­v<IntType> is true.

Effects:Equivalent to:return b = b >> shift;

template<class IntType> constexpr byte operator>>(byte b, IntType shift) noexcept;

Constraints: is_­integral_­v<IntType> is true.

Effects:Equivalent to:

return static_cast(static_cast(b) >> shift);

constexpr byte& operator|=(byte& l, byte r) noexcept;

Effects:Equivalent to: return l = l | r;

constexpr byte operator|(byte l, byte r) noexcept;

Effects:Equivalent to:

return static_cast(static_cast(l) | static_cast(r));

constexpr byte& operator&=(byte& l, byte r) noexcept;

Effects:Equivalent to: return l = l & r;

constexpr byte operator&(byte l, byte r) noexcept;

Effects:Equivalent to:

return static_cast(static_cast(l) & static_cast(r));

constexpr byte& operator^=(byte& l, byte r) noexcept;

Effects:Equivalent to: return l = l ^ r;

constexpr byte operator^(byte l, byte r) noexcept;

Effects:Equivalent to:

return static_cast(static_cast(l) ^ static_cast(r));

constexpr byte operator~(byte b) noexcept;

Effects:Equivalent to:

return static_cast(~static_cast(b));

template<class IntType> constexpr IntType to_integer(byte b) noexcept;

Constraints: is_­integral_­v<IntType> is true.

Effects:Equivalent to: return static_­cast<IntType>(b);