Website Summary Files Commits Branches @commit @diff @stats
path: root / src / String / String.cpp
diff options
context:
space:
mode:
1 files changed, 4 insertions, 2 deletions
-rw-r--r--src/String/String.cpp6
diff --git a/src/String/String.cpp b/src/String/String.cpp
index ee9c9df..72db76c 100644
--- a/src/String/String.cpp
+++ b/src/String/String.cpp
@@ -46,10 +46,12 @@ String::~String() {
}
String::String(String&& other) {
- moveFrom(other);
+ str = other.str;
+ other.str = nullptr;
+ length = other.length;
}
-String& String::operator=(const String& other) {
+String& String::operator=(String&& other) {
if (this != &other) {
free();
moveFrom(other);