mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
[Core] Prevent copying of SelfList and SelfList::List
Copying of these types is unsafe and should be detected Also removed unnecessary constructors for `TileMap` `DebugQuadrant` and `RenderingQuadrant` which used copying of `SelfList::List`
This commit is contained in:
@@ -159,6 +159,9 @@ public:
|
||||
_FORCE_INLINE_ SelfList<T> *first() { return _first; }
|
||||
_FORCE_INLINE_ const SelfList<T> *first() const { return _first; }
|
||||
|
||||
// Forbid copying, which has broken behavior.
|
||||
void operator=(const List &) = delete;
|
||||
|
||||
_FORCE_INLINE_ List() {}
|
||||
_FORCE_INLINE_ ~List() {
|
||||
// A self list must be empty on destruction.
|
||||
@@ -185,6 +188,9 @@ public:
|
||||
_FORCE_INLINE_ const SelfList<T> *prev() const { return _prev; }
|
||||
_FORCE_INLINE_ T *self() const { return _self; }
|
||||
|
||||
// Forbid copying, which has broken behavior.
|
||||
void operator=(const SelfList<T> &) = delete;
|
||||
|
||||
_FORCE_INLINE_ SelfList(T *p_self) {
|
||||
_self = p_self;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user