63 byte() noexcept = default;
94 template<typename T = value_type, enable_if_t<is_integral<T>::value,
bool> =
true>
95 [[nodiscard]] constexpr T
98 return static_cast<T>(m_data);
104 ~byte() noexcept = default;
112 constexpr
byte(
byte const &o) noexcept = default;
120 constexpr
byte(
byte &&o) noexcept = default;
129 constexpr
byte &operator=(
byte const &o) &noexcept = default;
138 constexpr
byte &operator=(
byte &&o) &noexcept = default;
156 byte(O val) noexcept = delete;
174 operator==(
byte const &lhs,
byte const &rhs) noexcept
176 return lhs.to_integer() == rhs.to_integer();
192 return !(lhs == rhs);
208 b =
byte{static_cast<bsl::uint8>(b.to_integer<
bsl::uint32>() << shift)};
225 b =
byte{static_cast<bsl::uint8>(b.to_integer<
bsl::uint32>() >> shift)};
281 lhs =
byte{static_cast<bsl::uint8>(lhs32 | rhs32)};
301 lhs =
byte{static_cast<bsl::uint8>(lhs32 & rhs32)};
321 lhs =
byte{static_cast<bsl::uint8>(lhs32 ^ rhs32)};
391 return byte{static_cast<bsl::uint8>(~b.to_integer<
bsl::uint32>())};
~byte() noexcept=default
Destroyes a previously created bsl::byte.
::uint8_t uint8
defines an 8bit unsigned integer
Definition: cstdint.hpp:45
byte() noexcept=default
Default constructor. This ensures the byte type is a POD type, allowing it to be constructed as a glo...
constexpr bool operator!=(byte const &lhs, byte const &rhs) noexcept
The same as !(lhs == rhs)
Definition: byte.hpp:190
constexpr byte & operator&=(byte &lhs, byte const &rhs) noexcept
The same as lhs = byte{lhs.to_integer() & rhs.to_integer()};.
Definition: byte.hpp:296
constexpr byte operator>>(byte const &b, bsl::uint32 const shift) noexcept
The same as byte tmp{b}; tmp >>= shift;.
Definition: byte.hpp:258
constexpr byte operator^(byte const &lhs, byte const &rhs) noexcept
The same as tmp{lhs}; tmp ^= rhs;.
Definition: byte.hpp:372
::uint32_t uint32
defines an 32bit unsigned integer
Definition: cstdint.hpp:49
constexpr T to_integer() const noexcept
Returns the bsl::byte as a given integer type using a static_cast to perform the conversion.
Definition: byte.hpp:96
constexpr byte operator~(byte const &b) noexcept
The same as byte{~b.to_integer()}.
Definition: byte.hpp:389
constexpr byte operator|(byte const &lhs, byte const &rhs) noexcept
The same as tmp{lhs}; tmp |= rhs;.
Definition: byte.hpp:336
constexpr byte operator<<(byte const &b, bsl::uint32 const shift) noexcept
The same as byte tmp{b}; tmp <<= shift;.
Definition: byte.hpp:240
constexpr byte & operator^=(byte &lhs, byte const &rhs) noexcept
The same as lhs = byte{lhs.to_integer() ^ rhs.to_integer()};.
Definition: byte.hpp:316
constexpr byte operator &(byte const &lhs, byte const &rhs) noexcept
The same as tmp{lhs}; tmp &= rhs;.
Definition: byte.hpp:354
constexpr byte & operator|=(byte &lhs, byte const &rhs) noexcept
The same as lhs = byte{lhs.to_integer() | rhs.to_integer()};.
Definition: byte.hpp:276
constexpr byte & operator<<=(byte &b, bsl::uint32 const shift) noexcept
The same as b = byte{b.to_integer() << shift}.
Definition: byte.hpp:206
constexpr byte & operator>>=(byte &b, bsl::uint32 const shift) noexcept
The same as b = byte{b.to_integer() >> shift}.
Definition: byte.hpp:223
bsl::uint8 value_type
alias for: T
Definition: byte.hpp:53
std::byte is a distinct type that implements the concept of byte as specified in the C++ language def...
Definition: byte.hpp:49