diff --git a/cores/esp8266/WString.cpp b/cores/esp8266/WString.cpp index 5498f8a23f..46aad5d5a0 100644 --- a/cores/esp8266/WString.cpp +++ b/cores/esp8266/WString.cpp @@ -46,12 +46,12 @@ String::String(const __FlashStringHelper *pstr) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ -String::String(String &&rval) { +String::String(String &&rval) noexcept { init(); move(rval); } -String::String(StringSumHelper &&rval) { +String::String(StringSumHelper &&rval) noexcept { init(); move(rval); } @@ -224,7 +224,7 @@ String & String::copy(const __FlashStringHelper *pstr, unsigned int length) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ -void String::move(String &rhs) { +void String::move(String &rhs) noexcept { if (buffer()) { if (capacity() >= rhs.len()) { memmove_P(wbuffer(), rhs.buffer(), rhs.length() + 1); @@ -267,13 +267,13 @@ String & String::operator =(const String &rhs) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ -String & String::operator =(String &&rval) { +String & String::operator =(String &&rval) noexcept { if (this != &rval) move(rval); return *this; } -String & String::operator =(StringSumHelper &&rval) { +String & String::operator =(StringSumHelper &&rval) noexcept { if (this != &rval) move(rval); return *this; diff --git a/cores/esp8266/WString.h b/cores/esp8266/WString.h index fb2f0797f0..8e2db3f9b9 100644 --- a/cores/esp8266/WString.h +++ b/cores/esp8266/WString.h @@ -57,8 +57,8 @@ class String { String(const String &str); String(const __FlashStringHelper *str); #ifdef __GXX_EXPERIMENTAL_CXX0X__ - String(String &&rval); - String(StringSumHelper &&rval); + String(String &&rval) noexcept; + String(StringSumHelper &&rval) noexcept; #endif explicit String(char c); explicit String(unsigned char, unsigned char base = 10); @@ -96,8 +96,8 @@ class String { String & operator =(const char *cstr); String & operator = (const __FlashStringHelper *str); #ifdef __GXX_EXPERIMENTAL_CXX0X__ - String & operator =(String &&rval); - String & operator =(StringSumHelper &&rval); + String & operator =(String &&rval) noexcept; + String & operator =(StringSumHelper &&rval) noexcept; #endif // concatenate (works w/ built-in types) @@ -317,7 +317,7 @@ class String { String & copy(const char *cstr, unsigned int length); String & copy(const __FlashStringHelper *pstr, unsigned int length); #ifdef __GXX_EXPERIMENTAL_CXX0X__ - void move(String &rhs); + void move(String &rhs) noexcept; #endif };