-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Converting to array not working #843
Comments
Duplicates #553 |
On the other hand: a conversion that checks the bounds and throws an exception in case the array does not match the JSON‘s size would be better here. |
@nlohmann |
Are you using the template<typename BasicJsonType, typename T, std::size_t N>
void from_json_array_impl(const BasicJsonType& j, std::array<T, N>& arr, priority_tag<2> /*unused*/)
{
for (std::size_t i = 0; i < N; ++i)
{
arr[i] = j.at(i).template get<T>();
}
} Up to |
@nlohmann I see the final release was in February, are there plans on a nearby official release? |
I hope to get the 3.0.0 release out this year. |
I'm closing this issue as there is nothing I can do here right now. |
Converting from an std array to json works fine.
However, the other way round gives errors.
I'm given the error that 'insert' doesn't exist for array.
Considering we're given j.size(), I believe this shouldn't be something that should be breaking.
(since I can already work around this by creating a loop that adds individual elements)
The text was updated successfully, but these errors were encountered: