
Szymon Gatner wrote:
If you can control the ordering, you can avoid the problem. But this solution is error prone.
Yup, can't really do this now.
Making your own header file and defining `foreach` macro in the header might be a better solution: // my_foreach.h #include <boost/foreach.hpp> #include <boost/multi_index_container.hpp> #include <boost/multi_index/hashed_index.hpp> #include <boost/multi_index/ordered_index.hpp> #include <boost/multi_index/random_access_index.hpp> #include <boost/multi_index/sequenced_index.hpp> #define foreach BOOST_FOREACH Then, whenever you use `foreach`, include this header file. By doing so, you don't have to worry about the ordering of header files and the macro definition. Regards, Michel