I'm using opencv to read and write my app configuration file. I have a bool that i want to store there. It it saved as an int:
camera: auto_gain: 1
I try to read it the following way:
auto_gain=static_cast<bool>(static_cast<int>(camera["auto_gain"]));
but I get a warning:
warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
What is the correct way to parse bool in that case?