Boost logo

Boost :

From: Daniel James (daniel_at_[hidden])
Date: 2005-03-22 13:41:24


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_;
     }

     // ...
};


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk