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.
This proposal decouples the implementation of hash functions from how types get hashed.
[1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n398...
template< class Key, class Hash = std::hash<Key> > class BloomFilter;