Boris Schaeling
All the key extractors in the documentation of Boost.MultiIndex return one value for an element in a container. Is it somehow possible to use a 1:n relationship between element and value?
The documentation uses this container definition (among others):
typedef multi_index_container< employee, indexed_by< hashed_unique< const_mem_fun
> employee_set;
Let's assume an employee can have more than one name (std::string becomes std::vectorstd::string). Now if someone searches for Tom or John the same employee should be returned by the container. Is this possible?
No, I don't think it's possible in general. Take into account that when you insert an element x into a multi_index_container m, then x will appear exactly once when traversing any index of m. So if you want something like multiple retrieval within one index you'd have to insert x multiple times. I'm afraid you'll need a separate container to hold this 1:n relationship. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo