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.
Activity
gregmarr commentedon Sep 26, 2016
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
valuefunction like that, you need to provide a default of a compatible type.alessiodallapiazza commentedon Sep 28, 2016
Thank you, usually on windows I use the "windows" boolean.
It is just ugly on the code seen false and FALSE on the code.
gregmarr commentedon Sep 28, 2016
I agree, it's too bad that FALSE is the wrong type for this. Unfortunately, changing the type of FALSE would probably break too many things.
alessiodallapiazza commentedon Sep 28, 2016
Thank you for your support.