Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate const and modifying Matrix4 column accessors
Distinguish the methods which return a modifiable reference to columns by appending 'Ref' to the method name, i.e. xCol3Ref(), tColRef() etc. Calling code is updated to use these versions where a reference is *required*, either because it is assigned to as an lvalue or returned by const reference to a higher-level function. The remaining xCol3(), yCol3() etc methods now return by value. Changing a method from returning a reference to returning a value is potentially dangerous, because any calling code which continues to treat the returned value as if it were a reference (e.g. assigning to it) will do the wrong thing, and neither G++ nor CLang seem to be able to warn about this. Hopefully the combination of manual searching along with unit tests has ensured that there are no remaining uses of xCol3() which should be xCol3Ref().
- Loading branch information
Matthew Mott
committed
Sep 26, 2021
1 parent
eab2c3e
commit be2a97a
Showing
8 changed files
with
37 additions
and
37 deletions.
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
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