Re: [Boost-bugs] [Boost C++ Libraries] #2982: Required Arguments

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2982: Required Arguments
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-11-04 10:10:57


#2982: Required Arguments
------------------------------------------------+---------------------------
 Reporter: David Doria <daviddoria@…> | Owner: vladimir_prus
     Type: Feature Requests | Status: new
Milestone: Boost 1.39.0 | Component: program_options
  Version: Boost Development Trunk | Severity: Not Applicable
 Keywords: Required Arguments |
------------------------------------------------+---------------------------

Comment(by s.ochsenknecht@…):

 I just checked if it is possible to place the check in notify(), but there
 is one problem. The notify function just gets the variables_map parameter
 and not the options_description's which have the information about
 required options.

 I have following solutions in mind:

 1) in store() we store any required options with an empty value (if not
 occur) in the variables_map. In notify we then check for empty() and throw
 exception if empty() and required(). Any side effects? My preferred
 solution.

 2) we pass options_description's to notify() to be able to perform the
 cross check, but this breaks the interface (or we overload notify, but
 then its up to the user to choose the correct notify() ... :-(

 3) we store a reference/pointer to options_description's in variables_map.
 :-(

 ...

 Please comment. Thanks

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2982#comment:5>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC