-
-
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
How to add json objects to a map? #432
Comments
That entirely depends on your stored JSON objects. If all object values are integers, you can use |
No, the json object is not a scalar value, but a complex one, and I have to
store all of them.
I tried `basic_json`, but I got error saying something like template
instantiate not defined.
Regards,
David
…On Fri, Jan 20, 2017, 23:49 Niels Lohmann ***@***.***> wrote:
That entirely depends on your stored JSON objects. If all object values
are integers, you can use std::map<std::string, int> - but once you are
not sure, you need to create a container which is basically basic_json.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#432 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEAzReGHFNVMKrd67Pb5KeOU5-4PoiIks5rUNd4gaJpZM4LpQ1->
.
|
Yes, you need to fill the template parameters - can you try |
Of course I have tried `json`. How can I fill the template parameters?
…On Sat, Jan 21, 2017, 20:48 Niels Lohmann ***@***.***> wrote:
Yes, you need to fill the template parameters - can you try json?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#432 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEAzafzSPjE-3dSyEwDRfXdy_T9zCWuks5rUf6tgaJpZM4LpQ1->
.
|
You do not need to fill parameters if you use |
Ok, `map<string, json>` works. Previously, I invoked the `.insert` method
wrong, and it gives me an ambiguous error message which lead me to think
that my declaration were wrong.
Thanks,
David
…On Sat, Jan 21, 2017 at 8:52 PM Niels Lohmann ***@***.***> wrote:
You do not need to fill parameters if you use json- it is just a
specialization for basic_json. Can you please provide a detailed error
message?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#432 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAEAzY6mPku0iD0UjnIZz69jK8CT0glSks5rUf-JgaJpZM4LpQ1->
.
|
I have an array of json objects.
I want to put each of them into a map<string, ?> for easy look up.
But I have no idea what to use for ?.
The text was updated successfully, but these errors were encountered: