/bit

C++11/14/17 equivalent for C++20s <bit> https://en.cppreference.com/w/cpp/header/bit

Primary LanguageC++

<bit>

This repo provides a C++11/14/17 equivalent for C++20s <bit> header.

It aims for complete interface equivalence while still being performant, using builtin bitwise operations where available, and fallback slow implementations where not.

Dependencies

For testing and installing:

  • Meson sudo apt install meson

Caveats

[[nodiscard]] is only supported in C++17

constexpr functions are only supported in C++14

Usage

Include bit.hh and use bit:: namespace instead of std:: namespace

Building and Testing

test.sh