mirror of
https://github.com/godotengine/godot.git
synced 2025-01-22 18:43:29 -05:00
Add move semantics (constructor, assignment) to StringName
.
This commit is contained in:
parent
b9437c3938
commit
8c4e674770
1 changed files with 14 additions and 0 deletions
|
@ -188,8 +188,22 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
StringName &operator=(const StringName &p_name);
|
StringName &operator=(const StringName &p_name);
|
||||||
|
StringName &operator=(StringName &&p_name) {
|
||||||
|
if (_data == p_name._data) {
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
unref();
|
||||||
|
_data = p_name._data;
|
||||||
|
p_name._data = nullptr;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
StringName(const char *p_name, bool p_static = false);
|
StringName(const char *p_name, bool p_static = false);
|
||||||
StringName(const StringName &p_name);
|
StringName(const StringName &p_name);
|
||||||
|
StringName(StringName &&p_name) {
|
||||||
|
_data = p_name._data;
|
||||||
|
p_name._data = nullptr;
|
||||||
|
}
|
||||||
StringName(const String &p_name, bool p_static = false);
|
StringName(const String &p_name, bool p_static = false);
|
||||||
StringName(const StaticCString &p_static_string, bool p_static = false);
|
StringName(const StaticCString &p_static_string, bool p_static = false);
|
||||||
StringName() {}
|
StringName() {}
|
||||||
|
|
Loading…
Reference in a new issue