[ox/std] Add move operator to String

This commit is contained in:
Gary Talent 2020-06-20 02:58:32 -05:00
parent 0035faa416
commit 257e857116
2 changed files with 7 additions and 0 deletions

View File

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

View File

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