Re: [Boost-users] [Multi-Index] composite_key problems

----- Mensaje original ----- De: Andreas Volz <lists@brachttal.net> Fecha: Domingo, Octubre 30, 2005 8:15 pm Asunto: [Boost-users] [Multi-Index] composite_key problems
Hi,
I like to build a data structure and like to access it with different keys, so I try multi_index for this. [...] I hacked the basic example to get this working. My example compiles, but if I execute it, I get only warnings:
probe: /usr/include/boost/multi_index/detail/index_iterator.hpp:107: typename Node::value_type& boost::multi_index::detail::index_iterator<Node, Container>::operator*() const [with Node = Container>boost::multi_index::detail::ordered_index_node<boost:: multi_index::detail::index_node_base<learnedMeasure> Container>>, Container = Container>>boost::multi_index::detail::ordered_index<boost:: multi_index::composite_key<learnedMeasure, Container>>boost::multi_index::member<learnedMeasure, std::string, Container>>&learnedMeasure::measu .... more warnings
I put my example code online. Perhaps someone could take a look in it and help me to find this problem.
Hello Andreas, I can't compile your source right now, but from the looks of it I cannot see anything wrong. What compiler are you using? If MSVC++ 6.0 or 7.0, take into account they have non-conformances you must take into account when using Boost.MultiIndex, see http://boost.org/libs/multi_index/doc/compiler_specifics.html Your particular code won't work on either of these compilers due to problems with member<> and composite_key that are addresses in the aforementioned page. Is this the problem? If not, I'll try to get back to you in a couple of days. Best, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

Am Mon, 31 Oct 2005 13:51:50 +0100 schrieb JOAQUIN LOPEZ MU?Z:
I can't compile your source right now, but from the looks of it I cannot see anything wrong. What compiler are you using? If MSVC++ 6.0 or 7.0, take into account they have non-conformances you must take into account when using Boost.MultiIndex, see
I use Gentoo Linux with g++ (GCC) 3.3.6 And I compile it without debug.
http://boost.org/libs/multi_index/doc/compiler_specifics.html
Your particular code won't work on either of these compilers due to problems with member<> and composite_key that are addresses in the aforementioned page.
Is this the problem? If not, I'll try to get back to you in a couple of days.
I changed some code and now it works (nearly): http://cpp.sourceforge.net/?show=9560 But only if I look for the first index (here: blub2.target). If I search for the second index (e.g. "arm") I get no results. But if I change the index position in learnedMeasureSet I find the other index. I found this in the docs: "On the other hand, partial searches without specifying the first keys are not allowed." But I need to search for both keys alone. Is there no way to search for the second key without the first key? If this doesn't work I need to go back to my old solution. I resorted and copied all data to a second data structure for faster access. But I didn't like this. I hope there's a way with multi_index. regards Andreas
participants (2)
-
Andreas Volz
-
JOAQUIN LOPEZ MU?Z