Re: [Boost-bugs] [Boost C++ Libraries] #2994: default value output precision

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2994: default value output precision
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-11-10 13:42:29


#2994: default value output precision
------------------------------+---------------------------------------------
 Reporter: anonymous | Owner: vladimir_prus
     Type: Feature Requests | Status: new
Milestone: Boost 1.39.0 | Component: program_options
  Version: Boost 1.38.0 | Severity: Not Applicable
 Keywords: |
------------------------------+---------------------------------------------

Comment(by s.ochsenknecht@…):

 I'm afraid that a certain, hard coded, output precision wouldn't satisfy
 all users. But there as an overloaded version of default_value() which can
 be used to define the string representation of the default value:

 {{{
 ("maxlength", po::value<double>(&MaxLength?)->default_value(.1, "0.1"),
 "Maximum edge length to keep.")
 }}}

 This string is then used for the help output. I would recommend to use
 this approach.

 I attached a test case to show the usage of this functionality. Maybe
 documentation needs to be updated.

 Please comment.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2994#comment:1>
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