[support.types.byteops]

# 17 Language support library [[support]](./#support)

## 17.2 Common definitions [[support.types]](support.types#byteops)

### 17.2.5 byte type operations [support.types.byteops]

[ð](#lib:operator%3c%3c=,byte)

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

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L353)

*Constraints*: is_integral_v<IntType> is true[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L357)

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

[ð](#lib:operator%3c%3c,byte)

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

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L370)

*Constraints*: is_integral_v<IntType> is true[.](#3.sentence-1)

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L374)

*Effects*: Equivalent to:return static_cast<byte>(static_cast<unsigned int>(b) << shift);

[ð](#lib:operator%3e%3e=,byte)

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

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L389)

*Constraints*: is_integral_v<IntType> is true[.](#5.sentence-1)

[6](#6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L393)

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

[ð](#lib:operator%3e%3e,byte)

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

[7](#7)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L406)

*Constraints*: is_integral_v<IntType> is true[.](#7.sentence-1)

[8](#8)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L410)

*Effects*: Equivalent to:return static_cast<byte>(static_cast<unsigned int>(b) >> shift);

[ð](#lib:operator%7c=,byte)

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

[9](#9)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L424)

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

[ð](#lib:operator%7c,byte)

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

[10](#10)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L435)

*Effects*: Equivalent to:return static_cast<byte>(static_cast<unsigned int>(l) | static_cast<unsigned int>(r));

[ð](#lib:operator&=,byte)

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

[11](#11)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L449)

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

[ð](#lib:operator&,byte)

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

[12](#12)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L460)

*Effects*: Equivalent to:return static_cast<byte>(static_cast<unsigned int>(l) & static_cast<unsigned int>(r));

[ð](#lib:operator%5e=,byte)

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

[13](#13)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L474)

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

[ð](#lib:operator%5e,byte)

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

[14](#14)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L485)

*Effects*: Equivalent to:return static_cast<byte>(static_cast<unsigned int>(l) ^ static_cast<unsigned int>(r));

[ð](#lib:operator~,byte)

`constexpr byte operator~(byte b) noexcept;
`

[15](#15)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L499)

*Effects*: Equivalent to:return static_cast<byte>(~static_cast<unsigned int>(b));

[ð](#lib:to_integer,byte)

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

[16](#16)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L514)

*Constraints*: is_integral_v<IntType> is true[.](#16.sentence-1)

[17](#17)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L518)

*Effects*: Equivalent to: return static_cast<IntType>(b);
