Skip to content

Commit 1168f8d

Browse files
authored
Ported support for C++11 iterators. (SmingHub#1141)
See esp8266/Arduino#2267.
1 parent 277c716 commit 1168f8d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sming/Wiring/WString.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,11 @@ class String
215215
{
216216
getBytes((unsigned char *)buf, bufsize, index);
217217
}
218-
const char * c_str() const { return buffer; }
218+
const char* c_str() const { return buffer; }
219+
char* begin() { return buffer; }
220+
char* end() { return buffer + length(); }
221+
const char* begin() const { return c_str(); }
222+
const char* end() const { return c_str() + length(); }
219223

220224
// search
221225
int IRAM_ATTR indexOf(char ch) const;

0 commit comments

Comments
 (0)