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
Good evening,
I was playing with this fantastic project and while using the function value for getting a result from a json file I met an exception.
The problem is that the visual studio TRUE is not used as the same true.
My JSON file:
{
"ok": true
}
The error is when I use the value function with TRUE instead of true.
if (j.value("ok",false)) // WORKSif (j.value("ok",FALSE)) // EXCEPTION
This is because FALSE is an integer type, and you're using it to ask for a boolean value. They're not compatible. When using the value function like that, you need to provide a default of a compatible type.
Good evening,
I was playing with this fantastic project and while using the function
value
for getting a result from a json file I met an exception.The problem is that the visual studio
TRUE
is not used as the sametrue
.My JSON file:
The error is when I use the
value
function with TRUE instead of true.Some reference:
http://stackoverflow.com/questions/830067/when-should-bool-and-bool-be-used-in-c
The text was updated successfully, but these errors were encountered: