added move assignment operator

This commit is contained in:
DhruvMaroo
2021-05-30 12:33:40 +05:30
parent 689b5fb98b
commit bdc5674ace
2 changed files with 7 additions and 0 deletions

View File

@@ -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);
}