Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2004-05-07 09:21:57


Vladimir Prus wrote:
>
> Usage: options_description [options]
> Allowed options:
> --help : produce help message
> --optimization arg (=10) : optimization level
> -I [ --include-path ] arg : include path
> --input-file arg : input file
>
> The (=10) is meant to give default value. The only problem I've found is
> that we need to specify empty default value string for std::vector, which
> leads to code like this:
>
> ("second", value< vector<int > >()->default_value(vector<int>(1, 1),
> ""))
>
> Ok, maybe we just need 'vector_value' function which will take care of
> default values.

The default value could simply be given as a string in that case:
"(1,1)" or whatever. You could also use the OutputFormatters
library when it is accepted into Boost. (In that case, you just
wait for your automated solution.)

-- 
Rob Stewart                           stewart_at_[hidden]
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk