Repository navigation
Improvement: deleted move and copy constructor for the mesh handle - #2586
Open
lenaploetzke wants to merge 5 commits into
Open
lenaploetzke wants to merge 5 commits into
lenaploetzke wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2586 +/- ##
=======================================
Coverage 83.05% 83.05%
=======================================
Files 148 148
Lines 22259 22259
=======================================
Hits 18488 18488
Misses 3771 3771 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
sandro-elsweijer
requested changes
Oct 19, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2590
Describe your changes here:
@sandro-elsweijer asked me why i return unique_ptrs in the constructor wrappers. While thinking about this, i noticed that we should not move or copy the mesh in general as we store pointers to the mesh in each element which we would have to update. copying or moving can also be a problem in between set_adapt and commit because of the desing of the adapt registry where we also store a ref to the mesh.
Therefore i decided to delete the (automatically constructed bc of the explicit destructor) copy and move constructor.
For the constructor wrappers:
It would still be possible to return the instance of the mesh and not the unique ptr because we keep the address there.
But with unique ptr, we keep the object copyable and moveable.
We would not be able to copy the mesh into an existing variable with the "by value return", e.g replacing a mesh with a new one or construting the mesh in another function and returning it by value (move needed).
With the unique ptr, such things are possible.
All these boxes must be checked by the AUTHOR before requesting review:
Documentation:,Bugfix:,Feature:,Improvement:orOther:.All these boxes must be checked by the REVIEWERS before merging the pull request:
As a reviewer please read through all the code lines and make sure that the code is fully understood, bug free, well-documented and well-structured.
General
Tests
If the Pull request introduces code that is not covered by the github action (for example coupling with a new library):
Scripts and Wiki
scripts/internal/find_all_source_files.shto check the indentation of these files.License
doc/(or already has one).