Compile problems with multi_index on CW 9.3 (mac)?

I'm trying to use boost::multi_index for the first time, and I'm getting odd compile errors. I have a class with two "keys", a text one and a numeric one, and I want to have two indices into the collection. So, I tried several things, and all of them get the same error: 'index_class' is not a member of class 'boost::multi_index::ordered_unique<boost::multi_index::identity<Foo>, boost::multi_index::detail::null_arg, boost::multi_index::detail::null_arg>' (and then an amazing cascade after that) Here's the basic idea: typedef boost::multi_index_container < Foo, boost::multi_index::indexed_by < boost::multi_index::ordered_unique < boost::multi_index::identity < Foo >, LessThanNumeric >, boost::multi_index::ordered_unique < boost::multi_index::identity < Foo >, LessThanText > >
Foo_;
where LessThanNumeric (and LessThanText, too) looks like this: struct LessThanNumeric: std::binary_function< Foo, Foo, bool > { bool operator () ( const Foo& x, const Foo& y ) const { return x.NumericKey () < y.NumericKey (); } }; My source is at <http://www.idio.com/misc/mi-test.cpp> Anyone got any tips? Thanks! -- -- Marshall Marshall Clow Idio Software <mailto:marshall@idio.com> It is by caffeine alone I set my mind in motion. It is by the beans of Java that thoughts acquire speed, the hands acquire shaking, the shaking becomes a warning. It is by caffeine alone I set my mind in motion.

Marshall Clow <marshall <at> idio.com> writes:
I'm trying to use boost::multi_index for the first time, and I'm getting odd compile errors. I have a class with two "keys", a text one and a numeric one, and I want to have two indices into the collection.
So, I tried several things, and all of them get the same error: 'index_class' is not a member of class 'boost::multi_index::ordered_unique<boost::multi_index::identity<Foo>, boost::multi_index::detail::null_arg, boost::multi_index::detail::null_arg>' (and then an amazing cascade after that)
Seems to me you have forgotten to include <boost/multi_index/ordered_index.hpp>. If problems persist, please come back. Good luck, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
participants (2)
-
Joaquin M Lopez Munoz
-
Marshall Clow