Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

WString.h is not compatible to c++11 range-based loop #4837

Closed
Milestone
@Rotzbua

Description

I tried to use the new c++11 syntax with the default string class from arduino. Actually it fails because it has no begin or end.

Test-IDE: 1.6.8 (Win8.1 x64)
Board: Uno

Example code:

String temp = "abc";
for (auto tempchar : temp) {
 Serial.println(tempchar);
}

Error:

error: 'begin' was not declared in this scope
for (auto tempchar : temp) {
error: 'end' was not declared in this scope

Reference:
http://en.cppreference.com/w/cpp/language/range-for

Best

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /