You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when parsing values as double or float, cxxopts uses the fallback parser using stringstream. However, using input streams does not support a representation for infinity and NaN (see this stack overflow question) .
It seems that all that is needed to support passing "infinity" and similar values that can be properly parsed is to add two specialization of parse_value, one for double, that uses std::stod, and one for float, that uses std::stof.
Another specialization for long double could also be added that uses std::stold.
Currently when parsing values as
double
orfloat
, cxxopts uses the fallback parser using stringstream. However, using input streams does not support a representation for infinity andNaN
(see this stack overflow question) .It seems that all that is needed to support passing "infinity" and similar values that can be properly parsed is to add two specialization of
parse_value
, one fordouble
, that usesstd::stod
, and one forfloat
, that usesstd::stof
.Another specialization for
long double
could also be added that usesstd::stold
.Note that
std::stod
,std::stof
andstd::stold
were introduced in C++11.The text was updated successfully, but these errors were encountered: