Added move semantics to FString class

This commit is contained in:
alexey.lysiuk 2017-10-23 11:48:04 +03:00
commit 3e43572a87
2 changed files with 17 additions and 0 deletions

View file

@ -211,6 +211,21 @@ FString &FString::operator = (const FString &other)
}
return *this;
}
FString &FString::operator = (FString &&other)
{
assert (Chars != NULL);
if (&other != this)
{
Data()->Release();
Chars = other.Chars;
other.ResetToNull();
}
return *this;
}
FString &FString::operator = (const char *copyStr)
{
if (copyStr != Chars)