c++ - What's the proper way to set individual options with boost program_options? -


i want set individual option boost::program_options library. documentation doesn't seem cover this. variables_map structure library populates inherits map, adding following program (seems to) work:

namespace boost {     namespace program_options {         template <typename t>         void set_in_options(variables_map m, const std::string& option_name, const t& value) {             m.insert(std::make_pair(option_name, variable_value(value, false)));         }         void set_in_options(variables_map m, const std::string& option_name) {             m.insert(std::make_pair(option_name, variable_value(true, false)));         }     } } 

but surely library author has "right way" this?


Comments