We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is it possible to flatten fixed sized arrays to a single array?
Serialize
std::vector<Vec3> points = {{1,2,3} , {4,5,6} };
{ "points" : [ 1, 2, 3, 4, 5, 6 ] }
Deserialize
std::vector<Vec3> points = { {1,2,3} {4,5,6} };
The text was updated successfully, but these errors were encountered:
This feature is too specific to be added to this general-purpose JSON library. You may want to do the flattening/unflattening outside the library (see https://stackoverflow.com/questions/17294629/merging-flattening-sub-vectors-into-a-single-vector-c-converting-2d-to-1d for examples) and store std::vector<int> inside the JSON value. To avoid copies, you can use get_ref (see https://nlohmann.github.io/json/classnlohmann_1_1basic__json_afbd800010b67619463c0fce6e74f7878.html#afbd800010b67619463c0fce6e74f7878).
std::vector<int>
get_ref
Sorry, something went wrong.
Thanks. I will give it a try.
I'm closing the issue. If you experience any problems, feel free to ask and I will reopen it.
No branches or pull requests
Is it possible to flatten fixed sized arrays to a single array?
Serialize
Deserialize
The text was updated successfully, but these errors were encountered: