Skip to content

Commit

Permalink
Simplify captures for early cxx compat
Browse files Browse the repository at this point in the history
  • Loading branch information
mmore500 committed Nov 24, 2023
1 parent b052637 commit 48789ef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions avida-core/source/actions/PopulationActions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5291,7 +5291,7 @@ class cActionKillDemesHighestParasiteLoad : public cAction

const int num_eligible = std::count_if(
std::begin(deme_indices), std::end(deme_indices),
[&pop](const int d) { return not pop.GetDeme(d).IsEmpty(); }
[&](const int d) { return not pop.GetDeme(d).IsEmpty(); }
);
const int binomial_draw = ctx.GetRandom().GetRandBinomial(
num_eligible,
Expand All @@ -5306,22 +5306,22 @@ class cActionKillDemesHighestParasiteLoad : public cAction
std::transform(
std::begin(deme_indices), std::end(deme_indices),
std::begin(parasite_loads),
[&pop](const int d) { return pop.GetDeme(d).GetParasiteLoad(); }
[&](const int d) { return pop.GetDeme(d).GetParasiteLoad(); }
);

std::partial_sort(
std::begin(deme_indices),
std::next(std::begin(deme_indices), kill_quota),
std::end(deme_indices),
[&parasite_loads](const int d1, const int d2) {
[&](const int d1, const int d2) {
return parasite_loads[d1] > parasite_loads[d2];
}
);

std::for_each(
std::begin(deme_indices),
std::next(std::begin(deme_indices), kill_quota),
[&pop, &ctx](const int d) { pop.GetDeme(d).KillAll(ctx); }
[&](const int d) { pop.GetDeme(d).KillAll(ctx); }
);

} // End Process()
Expand Down

0 comments on commit 48789ef

Please sign in to comment.