diff options
author | Christopher Andrews <chris@arduino.land> | 2014-07-15 16:19:41 +1000 |
---|---|---|
committer | Cristian Maglie <c.maglie@arduino.cc> | 2016-04-20 16:07:52 +0200 |
commit | 6d6c9d36226be9312e4cf6e48f861a1647d1acaf (patch) | |
tree | 53843521fbfe99ba64d0ab901afc47b841ecfa21 /cores/arduino/WString.h | |
parent | 0489fe3ae8f836d5e37415c2c72da4f923e5bb73 (diff) |
Removed C++11 dependency for `begin()` and `end()`
As I was not able to base the return types of `begin()` & `end()` off the c_str() function, I have changed the source so the features can be used by C++98 code, while still allowing ranged loops in C++11.
Diffstat (limited to 'cores/arduino/WString.h')
-rw-r--r-- | cores/arduino/WString.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cores/arduino/WString.h b/cores/arduino/WString.h index 4667a0d..7335d4e 100644 --- a/cores/arduino/WString.h +++ b/cores/arduino/WString.h @@ -89,8 +89,6 @@ public: #if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) String & operator = (String &&rval); String & operator = (StringSumHelper &&rval); - auto begin() -> const char* { return c_str(); } - auto end() -> const char* { return c_str() + length(); } #endif // concatenate (works w/ built-in types) @@ -163,6 +161,8 @@ public: void toCharArray(char *buf, unsigned int bufsize, unsigned int index=0) const {getBytes((unsigned char *)buf, bufsize, index);} const char * c_str() const { return buffer; } + const char* begin() { return c_str(); } + const char* end() { return c_str() + length(); } // search int indexOf( char ch ) const; |