summaryrefslogtreecommitdiff
path: root/boost/random/detail/vector_io.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/random/detail/vector_io.hpp')
-rw-r--r--boost/random/detail/vector_io.hpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/boost/random/detail/vector_io.hpp b/boost/random/detail/vector_io.hpp
index 24508c210e..fe3869abb5 100644
--- a/boost/random/detail/vector_io.hpp
+++ b/boost/random/detail/vector_io.hpp
@@ -16,6 +16,7 @@
#include <vector>
#include <iosfwd>
#include <istream>
+#include <boost/io/ios_state.hpp>
namespace boost {
namespace random {
@@ -52,12 +53,14 @@ void read_vector(std::basic_istream<CharT, Traits>& is, std::vector<T>& vec)
is.setstate(std::ios_base::failbit);
return;
}
+ boost::io::basic_ios_exception_saver<CharT, Traits> e(is, std::ios_base::goodbit);
T val;
while(is >> std::ws >> val) {
vec.push_back(val);
}
if(is.fail()) {
is.clear();
+ e.restore();
if(!(is >> ch)) {
return;
}