[bit.syn] # 22 General utilities library [[utilities]](./#utilities) ## 22.11 Bit manipulation [[bit]](bit#syn) ### 22.11.2 Header synopsis [bit.syn] // all freestandingnamespace std {// [[bit.cast]](bit.cast "22.11.3 Function template bit_­cast"), bit_casttemplateconstexpr To bit_cast(const From& from) noexcept; // [[bit.byteswap]](bit.byteswap "22.11.4 byteswap"), byteswaptemplateconstexpr T byteswap(T value) noexcept; // [[bit.pow.two]](bit.pow.two "22.11.5 Integral powers of 2"), integral powers of 2templateconstexpr bool has_single_bit(T x) noexcept; templateconstexpr T bit_ceil(T x); templateconstexpr T bit_floor(T x) noexcept; templateconstexpr int bit_width(T x) noexcept; // [[bit.rotate]](bit.rotate "22.11.6 Rotating"), rotatingtemplateconstexpr T rotl(T x, int s) noexcept; templateconstexpr T rotr(T x, int s) noexcept; // [[bit.count]](bit.count "22.11.7 Counting"), countingtemplateconstexpr int countl_zero(T x) noexcept; templateconstexpr int countl_one(T x) noexcept; templateconstexpr int countr_zero(T x) noexcept; templateconstexpr int countr_one(T x) noexcept; templateconstexpr int popcount(T x) noexcept; // [[bit.endian]](bit.endian "22.11.8 Endian"), endianenum class endian { little = *see below*, big = *see below*, native = *see below*};}