The boost option parser allows one to assign a variable to store the option value, instead of using the so_long["typing"].as<bool>()
way:
bool flag_value;
entries.add_options()
("flag", value<bool>(&flag_value), "a simple flag value");
......
cout<<"flag value is: "<<flag_value<<endl;
However, the above option declaration does not create a simple flag option. It actually requires you to enter something as the value (--flag true|false|on|off|yes|no|1|0), which is not what I want.
So, is there any way store the result inside a boolean value, and still keep the option as a simple flag?