From: Chuck Messenger (chuckm_at_[hidden])
Date: 2003-05-26 11:05:01
Vladimir Prus wrote:
> Chuck Messenger wrote:
>>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);
> 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.
I would think it would be worth extra complication in the library code,
if it simplified the user interface.
>>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?
OK -- you're right. Looking again at your library's interface, then
deferred evaluation is what would happen.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk