Website Summary Files Commits Branches @commit @diff @stats
path: root / src / String / String.cpp
diff options
context:
space:
mode:
Commitadae257fc2cd71108b6b5e88a04e894359c26180 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-04-25 17:12:08 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-04-25 17:12:08 +0300
Filesd64987b387b71df1d4178d109e1577541b6b760d /src/String/String.cpp
FMI-OOP-P1_TicketSystem-adae257fc2cd71108b6b5e88a04e894359c26180.tar
FMI-OOP-P1_TicketSystem-adae257fc2cd71108b6b5e88a04e894359c26180.tar.gz
FMI-OOP-P1_TicketSystem-adae257fc2cd71108b6b5e88a04e894359c26180.zip
Parent90ce8dc2317c7afc6bf6c7e842f92a31678a4994 (diff)
Autocommit at 25.04.2022 @ 17:12
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);