diff --git a/Sources/Plasma/CoreLib/plString.h b/Sources/Plasma/CoreLib/plString.h index 3304ffac..d018dae3 100644 --- a/Sources/Plasma/CoreLib/plString.h +++ b/Sources/Plasma/CoreLib/plString.h @@ -281,6 +281,10 @@ public: template plString(const char (&literal)[_Sz]) { IConvertFromUtf8(literal, _Sz - 1); } + // Don't call the string literal constructor for stack arrays + template + plString(char (&literal)[_Sz]) { IConvertFromUtf8(literal, STRLEN_AUTO); } + /** Copy constructor. */ plString(const plString ©) : fUtf8Buffer(copy.fUtf8Buffer) { } @@ -306,6 +310,10 @@ public: template plString &operator=(const char (&literal)[_Sz]) { IConvertFromUtf8(literal, _Sz - 1); return *this; } + // Don't call the string literal operator= for stack arrays + template + plString &operator=(char (&literal)[_Sz]) { IConvertFromUtf8(literal, STRLEN_AUTO); return *this; } + /** Assignment operator. Same as plString(const plString &). */ plString &operator=(const plString ©) { fUtf8Buffer = copy.fUtf8Buffer; return *this; }