
Eric Niebler <eric <at> boost-consulting.com> writes:
lipik wrote:
Hi,
I use boost.Multindex in my code, to simulate std::map. The code works fine on VC++ 2003 and Intel Compiler 10, but after upgrading to ICL 11 (latest), I can't use BOOST_FOREACH macros like so:
[...]
In the mean time, you can try turning off rvalue detection by defining BOOST_FOREACH_NO_RVALUE_DETECTION. But then you can't use BOOST_FOREACH on rvalue sequence expressions.
I suspect it is not a simple case, since this compiles fine: typedef std::map<std::wstring, std::wstring> wsm; wsm sm_; BOOST_FOREACH(const wsm::value_type &sv, sm_) { wcslen(sv.first.c_str()); } The problem occurs where I have used Multindex to define maps (the value type is a pair-like class that has the 'second' member is marked mutable, because Multindex containers only expose the contained data as const). Oh, and it compiles with BOOST_FOREACH_NO_RVALUE_DETECTION defined. Thanks