Bit manipulation & numeric utilities
<bit>, bit_cast, endian, two's complement, math constants, midpoint/lerp, safe integer comparisons.
Connected features
Papers
11 · Toronto 2017 → Prague 2020Adds std::endian.
Adds std::bit_cast.
Adds has_single_bit, bit_ceil, bit_floor, bit_width.
Requires signed integers to be two's complement.
Adds std::midpoint and std::lerp.
Adds <bit>: rotl, rotr, countl_zero, popcount and friends.
Adds <numbers>: pi, e, sqrt2 and other mathematical constants.
Gives bit_ceil (then ceil2) a narrow contract.
Moves std::endian to <bit>.
Adds cmp_less, cmp_equal and friends for safe integer comparisons, plus in_range.
Renames the low-level bit functions (ispow2→has_single_bit, ceil2→bit_ceil…).