
22 Mar
2005
22 Mar
'05
6:41 p.m.
Thorsten Ottosen wrote:
Even so, does the extreamely rare situation, that a hash-container is used as index in a hash-container, justify that we should not use a generic default ?
But that was just a specific example of a general point - that we can't define a hash function for an object when we don't know what its equality function is. Another example: struct foo { int identity_; std::vector<int> values_; std::vector<int>::const_iterator begin() const { return values_.begin(); } std::vector<int>::const_iterator end() { return values_.end(); } friend bool operator==(foo const& x) const { return identity_ == x.identity_; } // ... };