翻转二进制码

uint32_t reverseBits(uint32_t n) {
    auto strBits = bitset<32>(n).to_string();
    return static_cast<uint32_t>(bitset<32>(string(strBits.crbegin(), strBits.crend())).to_ulong());
}
原文地址:https://www.cnblogs.com/wuOverflow/p/4711207.html