21 Mar
2007
21 Mar
'07
7:39 p.m.
On Wed, 21 Mar 2007 21:32:38 +0200, JOAQUIN LOPEZ MU?Z
I've been using Boost Multiindex quite a lot but don't understand why the code below inserts two items. The container has a unique hash index and the two items return the same hash value. Is this is a bug in the library or in my code? [...] indexed_by
> > Here's the problem: your key is shared_ptr<foo>, i.e., you compare *the pointers* rather than the pointed to foo objects. What you want is this instead:
indexed_by
>
thanks for your fast answer! But the hash function is still hash_value(const shared_ptr<foo> &f) or hash_value(const foo &f)? Boris