[boost-users][hash] adding hash_value to boost namespace(s)?

Hi, I'd like to define hash_value() for some types defined in Boost, in order to use those types in hashed containers. It seems that the only way to do this is to define hash_value() in namespace boost, or the inner namespaces (where the desired type is defined) - isn't it? Is this legal? Thank you, Igor'.

On 17/06/2008, Igor R
I'd like to define hash_value() for some types defined in Boost, in order to use those types in hashed containers. It seems that the only way to do this is to define hash_value() in namespace boost, or the inner namespaces (where the desired type is defined) - isn't it?
You could create a new type that wraps the boost type in another namespace, so that you can define hash_value in that namespace - but that might be a lot of effort. Or you could just use your own hash function.
Is this legal?
It's a grey area ;). It's up to your judgement - I expect you understand the issues. I don't think we should be too precious about this. After all, boost is open source. Also, please submit a feature request ticket using the boost trac: http://svn.boost.org/trac/boost/newticket Daniel

It's a grey area ;). It's up to your judgement - I expect you understand the issues. I don't think we should be too precious about this. After all, boost is open source.
Also, please submit a feature request ticket using the boost trac:
Ok, thank you. Regarding the ticket - I'm not sure about the library the ticket must belong to: should it be the Hash library or the library that defines the type? Right now I need the hashing function for some types from Date-Time, but probably it would be nice to have such a function for lots of other boost types.

2008/6/20 Igor R
Also, please submit a feature request ticket using the boost trac:
Ok, thank you.
Regarding the ticket - I'm not sure about the library the ticket must belong to: should it be the Hash library or the library that defines the type?
The library that defines the type, but cc me (my username is danieljames). I'll implement it if necessary, but it'll need to be reviewed by the library maintainer. I'll go through the other libraries to look for classes that could use hash_value at some point - I should really have done that ages ago. Daniel
participants (2)
-
Daniel James
-
Igor R