as I've just learned in in my other question, I could use a composite_key
for a struct, which has a std::vector
and an integer. Now my question is: Can I use this somehow to work with hashed_indecies?
Here an example similar to THIS:
struct unique_property
{
//the pair of int and std::vector<int> shall be unique
int my_int;
std::vector<int> my_vec;
};
typedef multi_index_container<
unique_property,
indexed_by<
hashed_unique< // indexed by my_int and every entry of my_vec
composite_key<
street_entry,
member<unique_property,int,&unique_property::my_int>,
member<unique_property,std::vector<int>,&unique_property::my_vec>
>
>,
random_access< >
>
> property_locator;
The problem is (of course) that a std::vector<int>
is no suitable hash-key. Can I put this code in an elegant wrapper (or something like that), to produce a hash-key from every entry of my_vec
as well?