Singletons should be NONCOPYABLE by default.
Details
Details
- Reviewers
wraitii - Group Reviewers
Restricted Owners Package (Owns No Changed Paths) - Commits
- rP22050: Simple refactoring of Singleton. Make it non-copyable.
- Apply the patch and compile the game.
- Run tests and makes sure that the number of passed tests is the same.
Diff Detail
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
source/lib/code_annotation.h | ||
---|---|---|
219 ↗ | (On Diff #6724) | By C++ refs the valid assign operator is: T& operator=(const T&) = delete; |
Comment Actions
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/differential/629/display/redirect
Comment Actions
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/differential/630/display/redirect
Comment Actions
Just tested, in Debug and Release build, all tests passed.
The patch does not change logic AFAICS so it should be pretty safe. In any case, if someone tried to use singletons incorrectly it should not compile, nor crash.