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

C++17 decomposition declaration support #1087

Closed
kenjichanhkg opened this issue May 14, 2018 · 3 comments
Closed

C++17 decomposition declaration support #1087

kenjichanhkg opened this issue May 14, 2018 · 3 comments

Comments

@kenjichanhkg
Copy link

Possible to support this syntax in the library?

auto j = "{\"abc\":[34]}"_json;
for (auto& [k, v] : j){ // compile error
}

std::map example:

std::map<int, int> m;
for (auto& [k, v] : m){ // this works
}
@gregmarr
Copy link
Contributor

Try this

for (auto& [k, v] : j.items()) {

@nlohmann
Copy link
Owner

@kenjichanhkg Can I close this issue?

@kenjichanhkg
Copy link
Author

O OK

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

No branches or pull requests

3 participants