Peter M. Groen
/
cxxopts
Toggle navigation
Sign in
Sign in
Project
Files
Commits
Network
Graphs
Milestones
Issues
0
Merge Requests
0
Labels
Wiki
Download as
Email Patches
Plain Diff
Browse Code ยป
Commit
65c13302b4e254d0959e06ef474e9c08f650cce5
Authored by
Jarryd Beck
2014-10-13 18:05:01 +1100
1 parent
aa0a3a41
put in place check for value error
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
src/cxxopts.hpp
src/cxxopts.hpp
View file @
65c1330
...
...
@@ -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>
...
...