
11 Aug
2011
11 Aug
'11
6:16 p.m.
Responding to my own question...
program_options does not accept NaN or Inf as valid double input.
1) Does this count as a bug?
It seems yes as the root cause appears to be a (now fixed for 1.48) bug in lexical_cast (https://svn.boost.org/trac/boost/ticket/5689). I have filed https://svn.boost.org/trac/boost/ticket/5776 against program_options with a milestone matching the lexical_cast bug.
2) Can anyone suggest a workaround (shy of using string-based parameters and calling strtod myself)?
lexical_cast would be a natural choice were it not for the above bug. Cheers, Rhys