
On 26 March 2011 02:26, Scott McMurray <me22.ca+boost@gmail.com> wrote:
With combine, you can also use a non-zero initial value, so Point(x,y) and BoundingBox(x,y) don't have the same hash, if you happen to mix types in your tables.
That's a good point, but since STL containers aren't polymorphic it's usually not the case. The boost hash function should always match the equality operator, so that would be appropriate for writing 'hash_value' if you have a polymorphic equality operator that always returns false for comparing a Point and a BoundingBox. If you're using the library to write a hash function for another purpose, that isn't really something I considered when writing the documentation. I probably wasn't clear enough that I saw the library as fairly single minded. I think it can work well if you're careful. The design of your hash library could make a more appropriate base.