Make a few first and send for review so that we can iron out style questions before we need to retouch hundreds of code lines later.
> Am 16.07.2014 um 22:09 schrieb GunChleoc <email address hidden>:
>
> I found a code example in a recent merge request, so I can take this one
> on
>
> 18 - container_iterate_const(std::vector<TribeBasicInfo>, s.tribes, i)
> 19 - if (i.current->name == player.tribe) {
> 20 + for (const TribeBasicInfo tmp_tribe : s.tribes)
> 21 + {
> 22 + if (tmp_tribe.name == player.tribe) {
> 23 s.players[number].tribe = actual_tribe;
> 24 - if (i.current->initializations.size() <= player.initialization_index) {
> 25 + if (tmp_tribe.initializations.size() <= player.initialization_index) {
> 26 player.initialization_index = 0;
> 27 }
> 28 }
> 29 + }
>
> ** Changed in: widelands
> Assignee: (unassigned) => GunChleoc (gunchleoc)
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1203629
>
> Title:
> Replace boost::foreach and container iterate with range based for
> loops
>
> Status in Widelands:
> Confirmed
>
> Bug description:
> I wanted to work on this right now, but realized that range based for
> are only supported with gcc >= 4.6, so it seems a little early to jump
> ship here. After b18 we should reconsider doing this move though.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/widelands/+bug/1203629/+subscriptions
Make a few first and send for review so that we can iron out style questions before we need to retouch hundreds of code lines later.
> Am 16.07.2014 um 22:09 schrieb GunChleoc <email address hidden>: iterate_ const(std: :vector< TribeBasicInfo> , s.tribes, i) number] .tribe = actual_tribe; >initialization s.size( ) <= player. initialization_ index) { initializations .size() <= player. initialization_ index) { initialization_ index = 0; /bugs.launchpad .net/bugs/ 1203629 /bugs.launchpad .net/widelands/ +bug/1203629/ +subscriptions
>
> I found a code example in a recent merge request, so I can take this one
> on
>
> 18 - container_
> 19 - if (i.current->name == player.tribe) {
> 20 + for (const TribeBasicInfo tmp_tribe : s.tribes)
> 21 + {
> 22 + if (tmp_tribe.name == player.tribe) {
> 23 s.players[
> 24 - if (i.current-
> 25 + if (tmp_tribe.
> 26 player.
> 27 }
> 28 }
> 29 + }
>
> ** Changed in: widelands
> Assignee: (unassigned) => GunChleoc (gunchleoc)
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https:/
>
> Title:
> Replace boost::foreach and container iterate with range based for
> loops
>
> Status in Widelands:
> Confirmed
>
> Bug description:
> I wanted to work on this right now, but realized that range based for
> are only supported with gcc >= 4.6, so it seems a little early to jump
> ship here. After b18 we should reconsider doing this move though.
>
> To manage notifications about this bug go to:
> https:/