3 ms·
I feel the use of vector<bool> is an iffy choice. The Bitcoin codebase has a simple Bloom filter implementation you can take a look at that has been in use for
by nly 11y ago
I feel the use of vector<bool> is an iffy choice.
The Bitcoin codebase has a simple Bloom filter implementation you can take a look at that has been in use for some time
https://github.com/bitcoin/bitcoin/blob/master/src/bloom.h https://github.com/bitcoin/bitcoin/blob/master/src/bloom.h
https://github.com/bitcoin/bitcoin/blob/master/src/bloom.cpp https://github.com/bitcoin/bitcoin/blob/master/src/bloom.cpp
- bmohlenhoff 11y agostd::bitset is also a good choice if the number of desired bits is known at compile time
- schmatz 11y agoI think this would probably be the best choice after templating the filter
- mavam 11y agoWhat's wrong with vector<bool> (other than its name)? The interface is exactly what you need to implement a bit-level abstraction in a language where this isn't a first-class primitive.