On 19/02/2016 11:53, peyman@ausdia.com wrote:
I am experiencing sporadic crashes that look like memory problem when I have nested (2 level) BOOST_FOREACH loops.
Reason I say it looks like memory problem is because slightest change will make it crash or not crash. For example, adding a simple cout would change it!
I cannot provide a testcase. So I am just wondering if anybody has experienced the same, or know what could be going on.
I am using Boost 1.57.
Without seeing a test case it's hard to say what issue you're running into, but the most common problem when using BOOST_FOREACH is doing something that modifies the collection being enumerated. This may be indirect, as a side effect of some method being called inside the BOOST_FOREACH, so it may not be immediately apparent. It could also be action on another thread.