diff options
author | David A. Mellis <d.mellis@arduino.cc> | 2011-03-13 16:46:06 -0400 |
---|---|---|
committer | David A. Mellis <d.mellis@arduino.cc> | 2011-03-13 16:46:06 -0400 |
commit | 76776e7a46b30ee84f48db146bf8dd642de2927a (patch) | |
tree | 68b124c9b80a6269cdfe0a544babbe857ebbac14 /cores/arduino/WString.cpp | |
parent | 98b403114c3d9edcb6b74938f07c68dccc3c2489 (diff) |
Moving move() to __GXX_EXPERIMENTAL_CXX0X__ only, adding operator bool().
Diffstat (limited to 'cores/arduino/WString.cpp')
-rw-r--r-- | cores/arduino/WString.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cores/arduino/WString.cpp b/cores/arduino/WString.cpp index 5dcf585..41c80e8 100644 --- a/cores/arduino/WString.cpp +++ b/cores/arduino/WString.cpp @@ -157,6 +157,7 @@ String & String::copy(const char *cstr, unsigned int length) return *this; } +#ifdef __GXX_EXPERIMENTAL_CXX0X__ void String::move(String &rhs) { if (buffer) { @@ -176,6 +177,7 @@ void String::move(String &rhs) rhs.capacity = 0; rhs.len = 0; } +#endif String & String::operator = (const String &rhs) { @@ -340,6 +342,11 @@ StringSumHelper & operator + (const StringSumHelper &lhs, unsigned long num) /* Comparison */ /*********************************************/ +String::operator bool() const +{ + return !!buffer; +} + int String::compareTo(const String &s) const { if (!buffer || !s.buffer) { |