-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move/copy mechanisms #8
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9da4037
Added `Face` move mechanism
kolayne 5d4f3cc
Minor includes optimization + bugfix
kolayne 08cbe2d
Added Polyhedron copy and move mechanisms
kolayne 17c845c
Added `Particle` move mechanism
kolayne e6bdd4c
Forbade both copying and moving `SimulationMap`
kolayne f04a32c
`MapNode` minor improvements
kolayne cafffe6
Updated `MapNode` move/copy mechanisms
kolayne d9b1a08
Forbade moving `Particle` objects
kolayne f8a9b04
Minor documentation improvement
kolayne d24294c
Added `SimulationMap` move mechanism
kolayne 40b94e4
Removed some strange comments inside of move constructors/assignment …
kolayne 0117a54
Fixed issue found during the review
tanya-kta dfa8b2f
Merge branch 'master' into move_copy_mechanisms
tanya-kta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Field
Face::vertices
has typeconst SpacePoint
. Other variables which were moved to private section of their classes have noconst
in their types orconst
was removed from the type. DoesFace::vertices
really need const in type?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, note, that the actual type is
const SpacePoint *
(*
is an important part). It is different from theconst SpacePoint *const
type (which would mean the fieldvertices
can't be modified), but the actual time means that the content of the array can't be modified without replacing the whole array. If the field was const pointer, it would take away the opportunity to, for example, move a face into an existing one, but the pointer to const only prevents us from accidentally modifying the vertices array (vertices of an existingFace
shouldn't change i. e. have a specific set of vertices, shouldn't they?). Because the field is private, it's already impossible to modify the array from outside of theFace
class, but is still possible to modify it from inside, which shouldn't happen and is worth protecting.The general rule is if you don't modify a variable, make it constant. This way you will get additional protection from your compiler