[Boost-bugs] [Boost C++ Libraries] #5776: program_options should understand "inf" and "nan"

Subject: [Boost-bugs] [Boost C++ Libraries] #5776: program_options should understand "inf" and "nan"
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-08-11 18:08:42


#5776: program_options should understand "inf" and "nan"
---------------------------------------------------+------------------------
 Reporter: Rhys Ulerich <rhys.ulerich@…> | Owner: vladimir_prus
     Type: Bugs | Status: new
Milestone: Boost 1.48.0 | Component: program_options
  Version: Boost 1.46.1 | Severity: Problem
 Keywords: |
---------------------------------------------------+------------------------
 program_options does not accept NaN or Inf as valid double input. This
 problem seems like it will be fixed automatically when #5689 arrives in
 1.48. I am setting the milestone accordingly.

 Recreate: the following sequence modifies the "Getting Started"
 first.cpp to accept double input:
 {{{
    cp $BOOST_SOURCE/libs/program_options/example/first.cpp .
    perl -pi -e 's/<int>/<double>/;' first.cpp
    LDFLAGS="-lboost_program_options" make first # ...or whatever
 }}}
 The modified example indeed barfs on NaN or Inf input:
 {{{
    $ ./first --compression=5.5
    Compression level was set to 5.5.

    $ ./first --compression=Inf
    error: in option 'compression': invalid option value 'Inf'

    $ ./first --compression=NaN
    error: in option 'compression': invalid option value 'NaN'
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5776>
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:07 UTC