]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/charstr.cpp
ICU-62123.0.1.tar.gz
[apple/icu.git] / icuSources / common / charstr.cpp
index 8bacd20ddc7a6828bb19741f332dea4dea112884..353f1d52542fa250a4e7012da7fadcb4144023d4 100644 (file)
 
 U_NAMESPACE_BEGIN
 
+CharString::CharString(CharString&& src) U_NOEXCEPT
+        : buffer(std::move(src.buffer)), len(src.len) {
+    src.len = 0;  // not strictly necessary because we make no guarantees on the source string
+}
+
+CharString& CharString::operator=(CharString&& src) U_NOEXCEPT {
+    buffer = std::move(src.buffer);
+    len = src.len;
+    src.len = 0;  // not strictly necessary because we make no guarantees on the source string
+    return *this;
+}
+
 CharString &CharString::copyFrom(const CharString &s, UErrorCode &errorCode) {
     if(U_SUCCESS(errorCode) && this!=&s && ensureCapacity(s.len+1, 0, errorCode)) {
         len=s.len;