From 65c13302b4e254d0959e06ef474e9c08f650cce5 Mon Sep 17 00:00:00 2001 From: Jarryd Beck Date: Mon, 13 Oct 2014 18:05:01 +1100 Subject: [PATCH] put in place check for value error --- src/cxxopts.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cxxopts.hpp b/src/cxxopts.hpp index 6a00950..d64bc3e 100644 --- a/src/cxxopts.hpp +++ b/src/cxxopts.hpp @@ -48,7 +48,13 @@ namespace cxxopts parse_value(const std::string& text, T& value) { std::istringstream is(text); - is >> value; + if (!(is >> value)) + { + } + + if (!is.eof()) + { + } } template