Added move semantics to FString class
This commit is contained in:
parent
7d97963005
commit
3e43572a87
2 changed files with 17 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue