I feel the use of vector<bool> is an iffy choice.<p>The Bitcoin codebase has a simple Bloom filter implementation you can take a look at that has been in use for some time<p><a href="https://github.com/bitcoin/bitcoin/blob/master/src/bloom.h" rel="nofollow">https://github.com/bitcoin/bitcoin/blob/master/src/bloom.h</a><p><a href="https://github.com/bitcoin/bitcoin/blob/master/src/bloom.cpp" rel="nofollow">https://github.com/bitcoin/bitcoin/blob/master/src/bloom.cpp</a>
This example works well for raw data but not for complex types. You could make the filter a template, taking the key and a "hasher" function as template args.
Learned something today. Thanks for the article.<p>Minor nit: it will save readers time if you call out that "p is the false positive error rate". (You reference the error rate, but don't attach a variable name to it.) I had to go to an external reference to figure that out, which meant I learned something else of course.
Or in C[0] or in Go[1]...<p>[0] - <a href="https://github.com/EricLagergren/bloom" rel="nofollow">https://github.com/EricLagergren/bloom</a>
[1] - <a href="https://github.com/EricLagergren/bloom-c" rel="nofollow">https://github.com/EricLagergren/bloom-c</a>
Is there a standard implementation "everybody uses"? Bloomd seems popular as a bloom filter server.<p><a href="https://github.com/armon/bloomd" rel="nofollow">https://github.com/armon/bloomd</a>
I have also experiments about Bloom Filter in python <a href="https://github.com/erenyagdiran/BloomFilter" rel="nofollow">https://github.com/erenyagdiran/BloomFilter</a>