aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Wouter van Kesteren <woutershep@gmail.com> 2014-03-29 15:02:59 +0100
committerAvatar Bo ├śrsted Andresen <zlin@exherbo.org> 2015-05-01 14:06:21 +0100
commit85d89c12188201297828c92ae60655ac93626361 (patch)
tree6bb5c3b442427782afb6d172cbb9866a30f7f010
parent092d6b1323fce831f60bee5f5c7f0be9b2c3aadb (diff)
downloadpaludis-85d89c12188201297828c92ae60655ac93626361.tar.gz
paludis-85d89c12188201297828c92ae60655ac93626361.tar.xz
Make bool destringify check for failbit.
To reduce code duplication it's implemented in terms of int destringify. Change-Id: I2b681b118178f13bd3d2f711b65a82767d834fd9
-rw-r--r--paludis/util/destringify.hh10
1 files changed, 1 insertions, 9 deletions
diff --git a/paludis/util/destringify.hh b/paludis/util/destringify.hh
index cf09b7e..1a97d01 100644
--- a/paludis/util/destringify.hh
+++ b/paludis/util/destringify.hh
@@ -121,15 +121,7 @@ namespace paludis
else if (s == "false")
return false;
else
- {
- std::istringstream ss(s);
- int i;
- ss >> i;
- if (ss.eof() && ! ss.bad())
- return i > 0;
- else
- throw Exception_(s);
- }
+ return Destringifier<int, Exception_>::do_destringify(s) > 0;
}
};