diff --git a/src/ox/std/string.cpp b/src/ox/std/string.cpp index 812776718..18d1b9bbe 100644 --- a/src/ox/std/string.cpp +++ b/src/ox/std/string.cpp @@ -70,6 +70,11 @@ const String &String::operator=(const String &src) noexcept { return *this = src.c_str(); } +const String &String::operator=(const String &&src) noexcept { + m_buff = ox::move(src.m_buff); + return *this; +} + const String &String::operator+=(const char *str) noexcept { std::size_t strLen = ox_strlen(str); auto currentLen = len(); diff --git a/src/ox/std/string.hpp b/src/ox/std/string.hpp index b0d932fa8..67b468e5f 100644 --- a/src/ox/std/string.hpp +++ b/src/ox/std/string.hpp @@ -41,6 +41,8 @@ class String { const String &operator=(const String &src) noexcept; + const String &operator=(const String &&src) noexcept; + const String &operator+=(const char *str) noexcept; const String &operator+=(char *str) noexcept;