You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've a function that receives a json reference as follows:
voidParameters::FillJson(json& object) const
{
// It iterates internal stuff here to add key/values into the given// object
}
and it's called from outside as follows:
parameters.FillJson(root["parameters"]);
where root is the parent json object. So root["parameters"] is created in place. If FillJson() above does not add any key to the given object, when printing root["parameters"] it outputs null.
So, how could I force object within FillJson() to be an empty object? I couldn't find any API for it.
The text was updated successfully, but these errors were encountered:
voidParameters::FillJson(json& object) const
{
// For it to be an object even if no key/values are added.
object = jon::object();
// It iterates internal stuff here to add key/values into the given// object
}
I've a function that receives a json reference as follows:
and it's called from outside as follows:
parameters.FillJson(root["parameters"]);
where
root
is the parent json object. Soroot["parameters"]
is created in place. IfFillJson()
above does not add any key to the givenobject
, when printingroot["parameters"]
it outputsnull
.So, how could I force
object
withinFillJson()
to be an empty object? I couldn't find any API for it.The text was updated successfully, but these errors were encountered: