From bdc5674ace9fc06a58497d0fc25cdff07cddf72b Mon Sep 17 00:00:00 2001 From: DhruvMaroo Date: Sun, 30 May 2021 12:33:40 +0530 Subject: added move assignment operator --- src/core/String.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/core/String.cpp') diff --git a/src/core/String.cpp b/src/core/String.cpp index 19e44f9..3414adf 100644 --- a/src/core/String.cpp +++ b/src/core/String.cpp @@ -99,6 +99,12 @@ void String::operator=(const String &s) { godot::api->godot_string_new_copy(&_godot_string, &s._godot_string); } +void String::operator=(String&& s) { + godot::api->godot_string_destroy(&_godot_string); + godot::api->godot_string_new_copy(&_godot_string, &s._godot_string); + godot::api->godot_string_destroy(&s._godot_string); +} + bool String::operator==(const String &s) const { return godot::api->godot_string_operator_equal(&_godot_string, &s._godot_string); } -- cgit v1.2.3