SmallString: Add missing copy construct/assign operators

This commit is contained in:
Stenzek 2023-12-11 00:21:05 +10:00 committed by Connor McLaughlin
parent 5338a4f17c
commit b7aea5b726
1 changed files with 48 additions and 0 deletions

View File

@ -253,12 +253,60 @@ public:
assign(move);
}
__fi SmallStackString(const SmallStackString& copy)
{
init();
assign(copy);
}
__fi SmallStackString(SmallStackString&& move)
{
init();
assign(move);
}
__fi SmallStackString(const std::string_view& sv)
{
init();
assign(sv);
}
__fi SmallStackString& operator=(const SmallStringBase& copy)
{
assign(copy);
return *this;
}
__fi SmallStackString& operator=(SmallStringBase&& move)
{
assign(move);
return *this;
}
__fi SmallStackString& operator=(const SmallStackString& copy)
{
assign(copy);
return *this;
}
__fi SmallStackString& operator=(SmallStackString&& move)
{
assign(move);
return *this;
}
__fi SmallStackString& operator=(const std::string_view& sv)
{
assign(sv);
return *this;
}
__fi SmallStackString& operator=(const char* str)
{
assign(str);
return *this;
}
// Override the fromstring method
__fi static SmallStackString from_format(const char* format, ...) /*printflike(1, 2)*/
{