From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-05-26 01:47:10
Chuck Messenger wrote:
> > As for me, I'm a bit unsure about introducing new syntax. In this case,
> > I'm not sure overloading of >> is 100% intuitive --- one can assume that
> > value of "magic" is read from "param" result, for example.
> OK, then how about this:
> magic = desc.option<int>("magic|value|magic value for program");
> val = desc.option("val||some value with a default", defValue);
> etc. (note that <int> is needed only in the first case, since there is
> no default value from which to infer the type).
That's better. OTOH, it still does not fit well in current scheme. Now,
everything can be configured using member functions of 'option_descirption'
class. The 'parameter' function adds some convenience, but in effect just
calls relevant methods internally.
The syntax above requires very special support.
> If you like, the assignments could even be deferred (although I don't
> see the point of doing that).
Can you clarify what's "deferred"? The above code, as I understand it, would
only say that option "val" should be stored in variable "val". The actual
storing will happen after parsing. Or do you have something else in mind?
> - Chuck
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk