-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Can not translate map with integer key to dict string ? #1664
Comments
Got it |
I understand the JSON requirement that keys must be strings. My question is then, what is the most convenient way to translate an |
That sounds like the right approach to me! |
Indeed this seems to work! :) here is what I did for any future travelers that need the same:
|
Is there any better way to do this nowadays? I had to make a new map type because I couldn't get class UnorderedMap : public std::unordered_map<int, double> {}; |
It is correct to translate to dict string when the key of map is string.
But translate to an array when it is an integer.
` std::map<int, int> c_map;
`
result:
[[1111,1],[2333,111]]
How could I solve it?
The text was updated successfully, but these errors were encountered: