Utilities for examining and manipulating individual bits.
◆ __cpp_lib_bit_cast
#define __cpp_lib_bit_cast |
Definition at line 69 of file bit.
◆ __cpp_lib_bitops
Definition at line 375 of file bit.
◆ __cpp_lib_endian
Definition at line 457 of file bit.
◆ __cpp_lib_int_pow2
#define __cpp_lib_int_pow2 |
Definition at line 431 of file bit.
◆ endian
Byte order constants.
The platform endianness can be checked by comparing std::endian::native
to one of std::endian::big
or std::endian::little
.
- Since
- C++20
Definition at line 466 of file bit.
◆ bit_cast()
constexpr _To std::bit_cast |
( |
const _From & |
__from | ) |
|
|
constexprnoexcept |
Create a value of type To
from the bits of from
.
- Template Parameters
-
_To | A trivially-copyable type. |
- Parameters
-
__from | A trivially-copyable object of the same size as _To . |
- Returns
- An object of type
_To
.
- Since
- C++20
Definition at line 81 of file bit.
◆ bit_ceil()
The smallest power-of-two not less than x
.
Definition at line 442 of file bit.
◆ bit_floor()
The largest power-of-two not greater than x
.
Definition at line 448 of file bit.
◆ bit_width()
The smallest integer greater than the base-2 logarithm of x
.
Definition at line 454 of file bit.
◆ countl_one()
The number of contiguous one bits, starting from the highest bit.
Definition at line 408 of file bit.
◆ countl_zero()
The number of contiguous zero bits, starting from the highest bit.
Definition at line 402 of file bit.
◆ countr_one()
The number of contiguous one bits, starting from the lowest bit.
Definition at line 420 of file bit.
◆ countr_zero()
The number of contiguous zero bits, starting from the lowest bit.
Definition at line 414 of file bit.
◆ has_single_bit()
◆ popcount()
The number of bits set in x
.
Definition at line 426 of file bit.
◆ rotl()
Rotate x
to the left by s
bits.
Definition at line 388 of file bit.
◆ rotr()
Rotate x
to the right by s
bits.
Definition at line 394 of file bit.