...
 
Commits (2)
  • Simon Praetorius's avatar
  • Carsten Gräser's avatar
    [!213] Use this pointer for subPreBasis(i) in lambdas [bugfix] · 40f32a47
    Carsten Gräser authored
    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
    40f32a47
......@@ -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;
}
......