Codechange: use std::string without const as return
Otherwise some compilers, e.g. MSVC, do not pick up that these are temporaries and as such it will pass the temporaries to `const std::string &` instead of the wanted `std::string &&`
This commit is contained in:
@@ -26,7 +26,7 @@ public:
|
||||
* @return A string.
|
||||
* @api -all
|
||||
*/
|
||||
virtual const std::string GetEncodedText() = 0;
|
||||
virtual std::string GetEncodedText() = 0;
|
||||
|
||||
/**
|
||||
* Convert a #ScriptText into a decoded normal string.
|
||||
@@ -44,7 +44,7 @@ class RawText : public Text {
|
||||
public:
|
||||
RawText(const std::string &text);
|
||||
|
||||
const std::string GetEncodedText() override { return this->text; }
|
||||
std::string GetEncodedText() override { return this->text; }
|
||||
private:
|
||||
const std::string text;
|
||||
};
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
/**
|
||||
* @api -all
|
||||
*/
|
||||
virtual const std::string GetEncodedText();
|
||||
virtual std::string GetEncodedText();
|
||||
|
||||
private:
|
||||
using ScriptTextRef = ScriptObjectRef<ScriptText>;
|
||||
|
Reference in New Issue
Block a user