Problem with multi_index_container

Hi All! This program demostrate the problem <code> #include <boost/multi_container_index.hpp> #include <boost/multi_index/ordered_index.hpp> int main(int argc, char* argv[] typedef boost::multi_index::multi_index_container<int> int_set; int_set s; int_set::iterator itr = s.begin(); ++itr; return 0; } </code> Program hangs up in increment if s is empty. I undestand that this is my problem. But may be "assert" can be inserted for such cases -- Ilya Shvetsov KranX Productions

Ilya Shvetsov ha escrito:
Hi All! This program demostrate the problem <code> #include <boost/multi_container_index.hpp> #include <boost/multi_index/ordered_index.hpp>
int main(int argc, char* argv[] typedef boost::multi_index::multi_index_container<int> int_set; int_set s; int_set::iterator itr = s.begin(); ++itr; return 0; }
</code>
Program hangs up in increment if s is empty. I undestand that this is my problem. But may be "assert" can be inserted for such cases
Hi Ilya You can enable the so-called safe mode by inserting this #define BOOST_MULTI_INDEX_ENABLE_SAFE_MODE prior to the inclusion of Boost.MultiIndex headers. With this mode switched on, this problem (and many others) gets asserted. More info about safe mode in http://boost-consulting.com/boost/libs/multi_index/doc/advanced_topics.html#... HTH Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

Joaquín Mª López Muñoz wrote:
Ilya Shvetsov ha escrito:
Hi Ilya
You can enable the so-called safe mode by inserting this
#define BOOST_MULTI_INDEX_ENABLE_SAFE_MODE
prior to the inclusion of Boost.MultiIndex headers. With this mode switched on, this problem (and many others) gets asserted. More info about safe mode in
http://boost-consulting.com/boost/libs/multi_index/doc/advanced_topics.html#...
HTH
Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
Thanks -- Ilya Shvetsov KranX Productions
participants (2)
-
Ilya Shvetsov
-
Joaquín Mª López Muñoz