Commit 65c13302b4e254d0959e06ef474e9c08f650cce5

Authored by Jarryd Beck
1 parent aa0a3a41

put in place check for value error

Showing 1 changed file with 7 additions and 1 deletions
src/cxxopts.hpp
... ... @@ -48,7 +48,13 @@ namespace cxxopts
48 48 parse_value(const std::string& text, T& value)
49 49 {
50 50 std::istringstream is(text);
51   - is >> value;
  51 + if (!(is >> value))
  52 + {
  53 + }
  54 +
  55 + if (!is.eof())
  56 + {
  57 + }
52 58 }
53 59  
54 60 template <typename T>
... ...