From 64599973e9c46f1f6845fcc233ea9dad287be0c7 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 7 Feb 2018 07:36:15 -0800 Subject: [PATCH] Enable stream exceptions (#581) --- include/fmt/ostream.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/fmt/ostream.h b/include/fmt/ostream.h index 550e314c..c93b82ed 100644 --- a/include/fmt/ostream.h +++ b/include/fmt/ostream.h @@ -90,6 +90,7 @@ template void format_value(basic_buffer &buffer, const T &value) { internal::FormatBuf format_buf(buffer); std::basic_ostream output(&format_buf); + output.exceptions(std::ios_base::failbit | std::ios_base::badbit); output << value; buffer.resize(buffer.size()); }