cmdopt: don't throw at end of option text
This commit is contained in:
parent
08e688bc1e
commit
b867298093
@ -38,15 +38,13 @@ namespace util { namespace cmdopt {
|
|||||||
option::value<T>::execute (const char *restrict str)
|
option::value<T>::execute (const char *restrict str)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
std::istringstream os (str);
|
std::istringstream is (str);
|
||||||
os.exceptions (
|
is.exceptions (
|
||||||
std::istringstream::failbit
|
std::istringstream::failbit
|
||||||
| std::istringstream::badbit
|
| std::istringstream::badbit
|
||||||
);
|
);
|
||||||
os >> m_data;
|
|
||||||
|
|
||||||
if (!os.eof ())
|
is >> m_data;
|
||||||
throw invalid_value (__func__);
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
throw invalid_value (__func__);
|
throw invalid_value (__func__);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user