From a9ee2a34d849135e207da8f1eedd42a646f20bc5 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 9 Dec 2023 22:06:59 +1000 Subject: [PATCH] SmallString: Add missing constructors/move operators --- src/common/small_string.h | 48 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/common/small_string.h b/src/common/small_string.h index 36cfad665..c5f63da74 100644 --- a/src/common/small_string.h +++ b/src/common/small_string.h @@ -243,12 +243,60 @@ public: assign(move); } + ALWAYS_INLINE SmallStackString(const SmallStackString& copy) + { + init(); + assign(copy); + } + + ALWAYS_INLINE SmallStackString(SmallStackString&& move) + { + init(); + assign(move); + } + ALWAYS_INLINE SmallStackString(const std::string_view& sv) { init(); assign(sv); } + ALWAYS_INLINE SmallStackString& operator=(const SmallStringBase& copy) + { + assign(copy); + return *this; + } + + ALWAYS_INLINE SmallStackString& operator=(SmallStringBase&& move) + { + assign(move); + return *this; + } + + ALWAYS_INLINE SmallStackString& operator=(const SmallStackString& copy) + { + assign(copy); + return *this; + } + + ALWAYS_INLINE SmallStackString& operator=(SmallStackString&& move) + { + assign(move); + return *this; + } + + ALWAYS_INLINE SmallStackString& operator=(const std::string_view& sv) + { + assign(sv); + return *this; + } + + ALWAYS_INLINE SmallStackString& operator=(const char* str) + { + assign(str); + return *this; + } + // Override the fromstring method static SmallStackString from_format(const char* format, ...) printflike(1, 2);