Header-only C++23 bit manipulation library in active vNext redesign
English | 简体中文
BitCal is a header-only bit manipulation library being redesigned for C++23 with an x86-64-first performance posture.
The new public model is centered on:
bit_block<Bits>for owning fixed-width storagebit_view/const_bit_viewfor non-owning access- free algorithms such as
bit_and<Bits>()
<bitcal/bitcal.hpp> remains the only stable public include seam.
BitCal is in an active vNext / 4.0.0 redesign.
- Breaking: the older
bitarray-centered public model is being replaced - Breaking: the minimum language baseline is now C++23
- Breaking: no code-level compatibility layer is planned for the older API
- Focus: Linux and Windows x86-64 are the primary optimization and validation targets
#include <bitcal/bitcal.hpp>
#include <iostream>
int main() {
bitcal::bit_block<256> lhs;
bitcal::bit_block<256> rhs;
auto out = bitcal::bit_and<256>(lhs.view(), rhs.view());
std::cout << out.word(0) << '\n';
}cmake -S . -B build-test -DCMAKE_BUILD_TYPE=Release -DBITCAL_BUILD_TESTS=ON -DBITCAL_BUILD_EXAMPLES=ON -DBITCAL_NATIVE_ARCH=ON
cmake --build build-test --config Release -j"$(nproc)"
ctest --test-dir build-test --output-on-failure -C Release- OpenSpec is the canonical source for active requirements:
openspec/ - Documentation architecture policy lives in
docs/README.md - Project status lives in
docs/en/status/index.mdanddocs/zh/status/index.md - Release history lives only in
CHANGELOG.mdandCHANGELOG.zh-CN.md
The legacy bitarray API is no longer part of the shipped vNext public surface. BitCal 4.x expects consumers to migrate to bit_block, bit_view / const_bit_view, and free algorithms through <bitcal/bitcal.hpp>.