Boost logo

Boost Users :

Subject: Re: [Boost-users] Multi Index Insertion with hashed index - non-primitive key
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2009-07-31 14:54:43


Jason Leger <jasonoleger <at> gmail.com> writes:

>
> Hey Everyone,I am basically trying to create a sorted hash
> map using boost multiindex. I am following the examples but
> I am unable to insert my object into the container when I
> use a non-primitive key.
>
> [...]
>
> // hashed on key
> hashed_unique<member<Data,Key,&Data::key> >

You forgot here to specify the custom hash predicate that
you even have already defined presumably for this purpose.
Replace with:

    // hashed on key
    hashed_unique<member<Data,Key,&Data::key>, KeyHash>

and you're done. Thanks for using Boost.MultiIndex,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net