diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-01 21:33:27 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-01 21:33:27 +0100 |
commit | af76b9a0ae58dc8c87548053a5bc310ad6be25ce (patch) | |
tree | b2aa5927ed19855c101120593b59a9c3224804ad /backend/String.cpp | |
parent | bdf6ac149ec260dab767663419731b302679f458 (diff) |
more small tweaks
Diffstat (limited to 'backend/String.cpp')
-rw-r--r-- | backend/String.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/backend/String.cpp b/backend/String.cpp index 381277e..c856d86 100644 --- a/backend/String.cpp +++ b/backend/String.cpp @@ -11,13 +11,24 @@ String::String() { } +String::String(const String & other) { + this->set(other.data(), other.size()); +} String & String::operator = (const String & other) { + if (this == &other) return *this; this->set(other.data(), other.size()); return *this; } -String::String(const String & other) { - this->set(other.data(), other.size()); +String::String(String && other) { + this->_data = other._data; + this->_data_len = other._data_len; +} +String & String::operator = (String && other) { + if (this == &other) return *this; + this->_data = other._data; + this->_data_len = other._data_len; + return *this; } String::String(const char * c_str) { |