Commit 40f32a47 authored by Carsten Gräser's avatar Carsten Gräser

[!213] Use this pointer for subPreBasis(i) in lambdas [bugfix]

Merge branch 'issue/subprebasis_this' into 'master'

ref:staging/dune-functions

### Summary

Adds the pointer this-> when calling subPreBasis(i) inside of lambdas.

### Details

The recently introduced function subPreBasis(i) that returns the i'th
subPreBasis is used in lambdas without the this-> pointer. This is fine in
recent compilers, but fails in gcc6.

### Discussion

Maybe one should add a test for older compilers in the ci system, to catch
such bugs.

See merge request [!213]

  [!213]: gitlab.dune-project.org/staging/dune-functions/merge_requests/213
parents 84de71c8 b41da74f
Pipeline #18807 passed with stage
in 8 minutes and 57 seconds
......@@ -152,7 +152,7 @@ public:
void update(const GridView& gv)
{
Hybrid::forEach(ChildIndices(), [&](auto i) {
subPreBasis(i).update(gv);
this->subPreBasis(i).update(gv);
});
}
......@@ -246,7 +246,7 @@ public:
size_type r=0;
// Accumulate dimension() for all subprebases
Hybrid::forEach(ChildIndices(), [&](auto i) {
r += Hybrid::elementAt(subPreBases_, i).dimension();
r += this->subPreBasis(i).dimension();
});
return r;
}
......@@ -257,7 +257,7 @@ public:
size_type r=0;
// Accumulate maxNodeSize() for all subprebases
Hybrid::forEach(ChildIndices(), [&](auto i) {
r += Hybrid::elementAt(subPreBases_, i).maxNodeSize();
r += this->subPreBasis(i).maxNodeSize();
});
return r;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment