On Mon, April 23, 2007 18:27, Joaquín Mª López Muñoz wrote:
Hello Ovanes, the issue of using a boost::tuple member as a key for a Boost.MultiIndex index has arisen in the past. Please read the following posts:
http://lists.boost.org/boost-users/2005/12/16087.php http://lists.boost.org/boost-users/2005/12/16088.php
Do they address your problem? Best regards,
Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
Thanks for the quick answer. If I correctly understand your answer, I will need either to use a
custom key extractor, but then I can't make lookup by key like int or string, since I am forced to
pass the whole tuple instance where the key is extracted. Is it true? Other solution would be to
avoid using tuples...
One more question, which might be offtopic. In my other scenario I use boost::hash to hash for
string member of a pair, but the find fails if I pass a string const& and works if I pass const
char*.
Here an example:
typedef std::pair
types_map;
This would fail: inline some_type_ptr create_type(std::string const& name)const { types_map::index<hash>::type::const_iterator i =types_.get<hash>().find(name); //... } But this works: inline some_type_ptr create_type(std::string const& name)const { types_map::index<hash>::type::const_iterator i =types_.get<hash>().find(name.c_str); ^^^^^^^^^^^^^^^^^ //... } Many thanks and With Kind Regards, Ovanes Markarian