Boost logo

Boost Users :

Subject: [Boost-users] Changing format of program_options
From: Heikki Virtanen (heikki.a.virtanen_at_[hidden])
Date: 2013-09-02 16:08:34


Hi, I have tried to read config file using boost::program_options
where I have large floating pointing numbers like

[test_section]
test = 1.432e43

but seems that I get bad an error message
"boost::bad_any_cast: failed conversion using boost::any_cast"
when I am reading the value from program_options::variables_map.
Reading works perfectly when I am using numbers like

[test_section]
a = 13.62

but scientific format fails. Should I tell to variables_map somehow
what is the format of floating point numbers or should I do
something else?

-Heikki
                                               



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net