|
39 | 39 | #include "core/typedefs.h"
|
40 | 40 | #include "core/variant/array.h"
|
41 | 41 |
|
| 42 | +#include <utility> |
| 43 | + |
42 | 44 | /*************************************************************************/
|
43 | 45 | /* Utility Functions */
|
44 | 46 | /*************************************************************************/
|
@@ -193,7 +195,10 @@ class Char16String {
|
193 | 195 |
|
194 | 196 | _FORCE_INLINE_ Char16String() {}
|
195 | 197 | _FORCE_INLINE_ Char16String(const Char16String &p_str) { _cowdata._ref(p_str._cowdata); }
|
| 198 | + _FORCE_INLINE_ Char16String(Char16String &&p_str) : |
| 199 | + _cowdata(std::move(p_str._cowdata)) {} |
196 | 200 | _FORCE_INLINE_ void operator=(const Char16String &p_str) { _cowdata._ref(p_str._cowdata); }
|
| 201 | + _FORCE_INLINE_ void operator=(Char16String &&p_str) { _cowdata = std::move(p_str._cowdata); } |
197 | 202 | _FORCE_INLINE_ Char16String(const char16_t *p_cstr) { copy_from(p_cstr); }
|
198 | 203 |
|
199 | 204 | void operator=(const char16_t *p_cstr);
|
@@ -235,7 +240,10 @@ class CharString {
|
235 | 240 |
|
236 | 241 | _FORCE_INLINE_ CharString() {}
|
237 | 242 | _FORCE_INLINE_ CharString(const CharString &p_str) { _cowdata._ref(p_str._cowdata); }
|
| 243 | + _FORCE_INLINE_ CharString(CharString &&p_str) : |
| 244 | + _cowdata(std::move(p_str._cowdata)) {} |
238 | 245 | _FORCE_INLINE_ void operator=(const CharString &p_str) { _cowdata._ref(p_str._cowdata); }
|
| 246 | + _FORCE_INLINE_ void operator=(CharString &&p_str) { _cowdata = std::move(p_str._cowdata); } |
239 | 247 | _FORCE_INLINE_ CharString(const char *p_cstr) { copy_from(p_cstr); }
|
240 | 248 |
|
241 | 249 | void operator=(const char *p_cstr);
|
@@ -594,7 +602,10 @@ class String {
|
594 | 602 |
|
595 | 603 | _FORCE_INLINE_ String() {}
|
596 | 604 | _FORCE_INLINE_ String(const String &p_str) { _cowdata._ref(p_str._cowdata); }
|
| 605 | + _FORCE_INLINE_ String(String &&p_str) : |
| 606 | + _cowdata(std::move(p_str._cowdata)) {} |
597 | 607 | _FORCE_INLINE_ void operator=(const String &p_str) { _cowdata._ref(p_str._cowdata); }
|
| 608 | + _FORCE_INLINE_ void operator=(String &&p_str) { _cowdata = std::move(p_str._cowdata); } |
598 | 609 |
|
599 | 610 | Vector<uint8_t> to_ascii_buffer() const;
|
600 | 611 | Vector<uint8_t> to_utf8_buffer() const;
|
|
0 commit comments