Skip to content

Commit e414de7

Browse files
committed
Add back C++11 compile time check
1 parent fee6567 commit e414de7

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

api/String.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ String::String(const __FlashStringHelper *pstr)
6363
*this = pstr;
6464
}
6565

66+
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
6667
String::String(String &&rval)
6768
: buffer(rval.buffer)
6869
, capacity(rval.capacity)
@@ -72,6 +73,7 @@ String::String(String &&rval)
7273
rval.capacity = 0;
7374
rval.len = 0;
7475
}
76+
#endif
7577

7678
String::String(char c)
7779
{
@@ -211,6 +213,7 @@ String & String::copy(const __FlashStringHelper *pstr, unsigned int length)
211213
return *this;
212214
}
213215

216+
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
214217
void String::move(String &rhs)
215218
{
216219
if (this != &rhs)
@@ -226,6 +229,7 @@ void String::move(String &rhs)
226229
rhs.capacity = 0;
227230
}
228231
}
232+
#endif
229233

230234
String & String::operator = (const String &rhs)
231235
{
@@ -237,11 +241,13 @@ String & String::operator = (const String &rhs)
237241
return *this;
238242
}
239243

244+
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
240245
String & String::operator = (String &&rval)
241246
{
242247
move(rval);
243248
return *this;
244249
}
250+
#endif
245251

246252
String & String::operator = (const char *cstr)
247253
{

api/String.h

+6
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ class String
7272
String(const uint8_t *cstr, unsigned int length) : String((const char*)cstr, length) {}
7373
String(const String &str);
7474
String(const __FlashStringHelper *str);
75+
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
7576
String(String &&rval);
77+
#endif
7678
explicit String(char c);
7779
explicit String(unsigned char, unsigned char base=10);
7880
explicit String(int, unsigned char base=10);
@@ -96,7 +98,9 @@ class String
9698
String & operator = (const String &rhs);
9799
String & operator = (const char *cstr);
98100
String & operator = (const __FlashStringHelper *str);
101+
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
99102
String & operator = (String &&rval);
103+
#endif
100104

101105
// concatenate (works w/ built-in types)
102106

@@ -227,7 +231,9 @@ class String
227231
// copy and move
228232
String & copy(const char *cstr, unsigned int length);
229233
String & copy(const __FlashStringHelper *pstr, unsigned int length);
234+
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
230235
void move(String &rhs);
236+
#endif
231237
};
232238

233239
class StringSumHelper : public String

0 commit comments

Comments
 (0)