Skip to content

Commit

Permalink
Return a copy for Geomerty::center()
Browse files Browse the repository at this point in the history
This is mandated by the DUNE interface. It also makes a lot of sense
because now people do not need to think whether
const auto& center = entity.geometry().center();
might cause a dangling reference. It just wont as it is always a copy
and never a reference to a member.
  • Loading branch information
blattms committed Aug 3, 2018
1 parent 161427f commit 75f2274
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion opm/grid/cpgrid/Geometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ namespace Dune
}

/// Returns the centroid of the geometry.
const GlobalCoordinate& center() const
GlobalCoordinate center() const
{
return pos_;
}
Expand Down

0 comments on commit 75f2274

Please sign in to comment.