Releases: TheLartians/BitLens
Releases · TheLartians/BitLens
v2.2: add PackageProject.cmake (#21)
* add PackageProject * add install workflow * add Badge * ok NOW add install workflow * fix install interface * remove non-existant dependencies
v2.1: Better const support (#15)
* add better const support * update version * rename benchmark section
New Iterator API
Why
Based on recent feedback the interface has been changed to resemble C++ standard library containers.
New API
#include <bit_lens.h>
#include <vector>
#include <algorithm>
int main() {
bit_lens::BitContainer<std::vector<unsigned>> bits; // create a bit container based on vector<unsigned>
// bit_lens::BitLens bits(container); // or create a lens into an existing container
bits.resize(10); // resize the container to store at least 10 bits
bits.size(); // the actual number of bits that the container can store
bits[8];// gets the 8th bit
bits[8] = 1; // sets the 8th bit
for (auto bit: bits) { bit = 1; } // iterate over all bits
std::count(bits.begin(), bits.end(), true); // <algorithm> compatible iterators
for (auto &v: bits.data()) { // access the underlying container
v &= 0b1101; // perform bitwise bulk operations for best performance (see benchmark)
}
}
Breaking: rename Project to BitLens
API changes:
- CMake's target name
BitView
->BitLens
- Namespace and class rename
bit_view::Container
->bit_lens::Lens
Type guards
Type safety (#10) * add type checks and fix #9. * increase version in readme (to be released after merge)
Remove branch in bit setter
v1.2 remove code artifact (#8)
v1.1.1
fill out all values when resizing (#4)
forEach
Merge pull request #3 from TheLartians/foreach forEach
First release
Merge pull request #1 from TheLartians/actionsB add github actions