From b7aea5b72618e006f3c3c3031f506c5658ff602c Mon Sep 17 00:00:00 2001 From: Stenzek Date: Mon, 11 Dec 2023 00:21:05 +1000 Subject: [PATCH] SmallString: Add missing copy construct/assign operators --- common/SmallString.h | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/common/SmallString.h b/common/SmallString.h index 5b3d2adcc1..574b7fce99 100644 --- a/common/SmallString.h +++ b/common/SmallString.h @@ -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)*/ {