|
Boost : |
Subject: Re: [boost] [program_options] validation_error in 1.42
From: Vladimir Prus (ghost_at_[hidden])
Date: 2010-03-09 11:39:59
Alexander Fokin wrote:
> It seems the way program_options deals with validation errors was
> changed in 1.42.
>
> Constructor of validation_error now takes kind_t and option name and
> value. Before 1.42 it was possible to specify what exactly was wrong
> with the option value in the constructor of validation_error. Now I
> see no options but to subclass validation_error. Was this change
> intentional?
It would expect so. IIUC, the change was made so that code that catches
validation_error can emit localized or otherwise customized error message.
Maybe, there should be an additional parameter to specify details?
> Also, documentation need to be fixed to reflect these changes. More
> precisely, the following line in "Custom Validators" section will lead
> to compilation error:
>> throw validation_error("invalid value");
Could you file an issue on http://svn.boost.org about this?
Thanks,
Volodya
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk