Boost logo

Boost Users :

From: Andreas Volz (lists_at_[hidden])
Date: 2005-10-30 14:15:31


Hi,

I like to build a data structure and like to access it with different
keys, so I try multi_index for this. My data structure looks like this:

struct learnedMeasure
{
  // target_name + measure_name together is the composite key
  std::string target_name;
  std::string measure_name;
  float negative;
  float positive;
  float zero;
}

I like to access this data structure like this in SQL:

SELECT measure, Negative, Positive, Zero from tabelle WHERE
       target_name='xxx'

SELECT Target_name, Negative, Positive, Zero from tabelle WHERE
       measure_name='xxx'

SELECT Negative,Positive,Zero from tabelle WHERE measure_name='xxx'
       AND Target_name='yyy'

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.

http://cpp.sourceforge.net/?show=9550

regards
Andreas


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