Most uses of BOOST_FOREACH should be replacable with a simple C++11 range-based for() iteration. Since this is now allowed on master for LibreOffice 4.5, we should get rid of BOOST_FOREACH, which is essentially a hack/backport to the same effect. When doing so, please also take care to remove the include directive for boost/foreach.hpp with the last removed macro. Here is an article describing ranged for: http://www.cprogramming.com/c++11/c++11-ranged-for-loop.html
Marking as enhancement Status -> NEW
(In reply to Björn Michaelsen from comment #0) > Most uses of BOOST_FOREACH should be replacable with a simple C++11 > range-based for() iteration ...or for-each and a lambda (depending on what looks more "natural" in a given case)
Assigned it to myself
I've been working on this bug since there seems to not have been activity on this bug for more than a week. It seems like converting to range-based for loops is fairly trivial except in this specific case shown here: http://opengrok.libreoffice.org/xref/core/sw/source/core/doc/CntntIdxStore.cxx#271 Apparently range-based for loops cannot be used to iterate over an std::pair. Does anyone have any advice on how to resolve this issue? I have replaced all instances of BOOST_FOREACH in the project except for this one already.
(In reply to Nathan Yee from comment #4) > http://opengrok.libreoffice.org/xref/core/sw/source/core/doc/CntntIdxStore. > cxx#271 > > Apparently range-based for loops cannot be used to iterate over an > std::pair. Does anyone have any advice on how to resolve this issue? Iterate over pRedlineTbl. That is what the current BOOST_FOREACH does, i.e., it iterates over a range defined by an std::pair of iterators.
Sent a patch for this bug over gerrit at https://gerrit.libreoffice.org/13714. I'm going to assign this bug to myself for the time being.
Nathan Yee committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=a509a8d9951a0c31bea0f4ff8942720cad8b6e7f Resolves: fdo#87003 Kill BOOST_FOREACH on master It will be available in 4.5.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Pieter Adriaensen committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=f29bf4635958f7d4b8a22c0825cbcca4858ba037 Resolves: fdo#87003 - Kill BOOST_FOREACH It will be available in 4.5.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyBeginner SkillCpp TopicCleanup) [NinjaEdit]
Remove LibreOffice Dev List from CC on EasyHacks (curtailing excessive email to list) [NinjaEdit]