Merge pull request #5566 from atgeirr/fix-cpp20ism

Avoid capturing structured bindings.
This commit is contained in:
Bård Skaflestad 2024-08-30 14:31:27 +02:00 committed by GitHub
commit a84359c1f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -975,14 +975,14 @@ namespace Opm {
// semicolon. This is an immediately invoked function
// expression which calculates a single boolean value.
const auto relax_pv_fraction_cnv =
[&report, pvSum, numAquiferPvSum, this]()
[&report, this, eligible = pvSum - numAquiferPvSum]()
{
const auto& cnvPvSplit = report.cnvPvSplit().first;
// [1]: tol < cnv <= relaxed
// [2]: relaxed < cnv
return static_cast<Scalar>(cnvPvSplit[1] + cnvPvSplit[2]) <
this->param_.relaxed_max_pv_fraction_ * (pvSum - numAquiferPvSum);
this->param_.relaxed_max_pv_fraction_ * eligible;
}();
const bool use_relaxed_cnv = relax_final_iteration_cnv