
2009/3/9
This raises the question: what is either_hash::argument_type ? But it seems this is not used by boost::unordered_set . It should probably be std::string to match the underlying hash table. Would it make sense to change find() to template <class query_type> const_iterator find(const query_type& q) const ?
FWIW, Boost.MultiIndex hashed indices do have a notion of "compatible keys" allowing for such heterogeneous lookup operations:
http://www.boost.org/libs/multi_index/doc/tutorial/indices.html#hash_lookup http://www.boost.org/libs/multi_index/doc/reference/hash_indices.html#lookup
In the equivalent to this case: boost::unordered_setstd::string set; // .... set.find("x"); Is a std::string constructed for every hash and equality call? I can't see a way to avoid that without introducing a traits class. Daniel