
Matthew Herrmann <matthew.herrmann <at> zomojo.com> writes:
Thorsten Ottosen wrote:
I tried using
bpo::options_description desc("Allowed options"); desc.add_options() (HELP, "produce help message");
but this fails to compile because HELP is an std::string.
I'd vote to replace const char* everywhere in the program options interface with std::string. (excluding the "char* argv[]" of course)
This would certainly help for cases where I construct the description string from other program details, i.e. it would avoid having to extract the "c_str ()", e.g. std::string otherProgramDetail; add_opt... ("option", ("blah blah " + otherProgramDetail + " more blah").c_str() ) Also: - The name/description are held as strings internally, anyway. - The "default_value()"'s second argument, for specifying the default value as a textual representation, _is_ an std::string. So it would improve consistency. So, +1. Regards, Chard.