Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to enumarate a map #1

Open
FFMG opened this issue Sep 15, 2016 · 2 comments
Open

Error when trying to enumarate a map #1

FFMG opened this issue Sep 15, 2016 · 2 comments
Assignees
Labels

Comments

@FFMG
Copy link
Owner

FFMG commented Sep 15, 2016

When creating a map, you cannot enumerate for end() because of != error.

...
typedef std::map< std::wstring, ::myodd::dynamic::Any > Values;
Values values;
...
for ( Values::const_iterator it = values.begin(); it != values.end(); ++it )
{
}
@FFMG FFMG added the bug label Sep 15, 2016
@FFMG FFMG self-assigned this Sep 15, 2016
@FFMG
Copy link
Owner Author

FFMG commented Sep 15, 2016

Tested on VS2015 and gcc 6.2

@FFMG
Copy link
Owner Author

FFMG commented Sep 24, 2016

Using auto instead of Values::const_iterator works, (because it is converted to a non const Values::iterator

...
typedef std::map< std::wstring, ::myodd::dynamic::Any > Values;
Values values;
...
for ( auto it = values.begin(); it != values.end(); ++it )
{
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant