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

from_json for std::array #625

Closed
hsdk123 opened this issue Jun 17, 2017 · 2 comments
Closed

from_json for std::array #625

hsdk123 opened this issue Jun 17, 2017 · 2 comments
Labels
solution: duplicate the issue is a duplicate; refer to the linked issue instead

Comments

@hsdk123
Copy link

hsdk123 commented Jun 17, 2017

Hi, I'm realising that for an std::array, I can pass in the array as in into json and the library will convert it for me automatically, whereas when I'm trying to create an std::array from json, the conversion doesn't occur automatically, giving me an error saying that 'array doesn't have an insert function'.

This might seem small, but can get very inconvenient - it would be great if we could also get auto conversion of json arrays into arrays without having to explicitly create one element by element.

@nlohmann nlohmann added the solution: duplicate the issue is a duplicate; refer to the linked issue instead label Jun 17, 2017
@nlohmann
Copy link
Owner

Duplicate: #553.

@nlohmann
Copy link
Owner

With #624, the library now also supports the conversion from/to std::pair, std::tuple, and std::array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution: duplicate the issue is a duplicate; refer to the linked issue instead
Projects
None yet
Development

No branches or pull requests

2 participants