Boost logo

Boost :

Subject: Re: [boost] [program_options]
From: Richard Hazlewood (boost_at_[hidden])
Date: 2010-03-05 04:02:18

Matthew Herrmann <matthew.herrmann <at>> 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;

    ("option", ("blah blah " + otherProgramDetail + " more blah").c_str() )

- 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

So, +1.


Boost list run by bdawes at, gregod at, cpdaniel at, john at