Updated String library to use C++11 iterators.
This will allow using the String library in a ranged for loop: ```C++ String s = "Hi, this is a test"; for( char c : s ) Serial.print( c ); ```
This commit is contained in:
parent
5e194bd8ef
commit
0489fe3ae8
|
@ -89,6 +89,8 @@ public:
|
||||||
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||||
String & operator = (String &&rval);
|
String & operator = (String &&rval);
|
||||||
String & operator = (StringSumHelper &&rval);
|
String & operator = (StringSumHelper &&rval);
|
||||||
|
auto begin() -> const char* { return c_str(); }
|
||||||
|
auto end() -> const char* { return c_str() + length(); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// concatenate (works w/ built-in types)
|
// concatenate (works w/ built-in types)
|
||||||
|
|
Loading…
Reference in New Issue