[ox/std] Add move operator to String
This commit is contained in:
parent
0035faa416
commit
257e857116
5
deps/ox/src/ox/std/string.cpp
vendored
5
deps/ox/src/ox/std/string.cpp
vendored
@ -70,6 +70,11 @@ const String &String::operator=(const String &src) noexcept {
|
|||||||
return *this = src.c_str();
|
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 {
|
const String &String::operator+=(const char *str) noexcept {
|
||||||
std::size_t strLen = ox_strlen(str);
|
std::size_t strLen = ox_strlen(str);
|
||||||
auto currentLen = len();
|
auto currentLen = len();
|
||||||
|
2
deps/ox/src/ox/std/string.hpp
vendored
2
deps/ox/src/ox/std/string.hpp
vendored
@ -41,6 +41,8 @@ class String {
|
|||||||
|
|
||||||
const String &operator=(const String &src) noexcept;
|
const String &operator=(const String &src) noexcept;
|
||||||
|
|
||||||
|
const String &operator=(const String &&src) noexcept;
|
||||||
|
|
||||||
const String &operator+=(const char *str) noexcept;
|
const String &operator+=(const char *str) noexcept;
|
||||||
|
|
||||||
const String &operator+=(char *str) noexcept;
|
const String &operator+=(char *str) noexcept;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user