diff --git a/include/date/date.h b/include/date/date.h index e17cce0..0e5a482 100644 --- a/include/date/date.h +++ b/include/date/date.h @@ -30,6 +30,8 @@ // been invented (that would involve another several millennia of evolution). // We did not mean to shout. +#include + #include #include #include @@ -5630,6 +5632,7 @@ format(const std::locale& loc, const CharT* fmt, const Streamable& tp) std::basic_string{}) { std::basic_ostringstream os; + os.exceptions(std::ios::failbit | std::ios::badbit); os.imbue(loc); to_stream(os, fmt, tp); return os.str(); @@ -5642,6 +5645,7 @@ format(const CharT* fmt, const Streamable& tp) std::basic_string{}) { std::basic_ostringstream os; + os.exceptions(std::ios::failbit | std::ios::badbit); to_stream(os, fmt, tp); return os.str(); } @@ -5654,6 +5658,7 @@ format(const std::locale& loc, const std::basic_string& fm std::basic_string{}) { std::basic_ostringstream os; + os.exceptions(std::ios::failbit | std::ios::badbit); os.imbue(loc); to_stream(os, fmt.c_str(), tp); return os.str(); @@ -5666,6 +5671,7 @@ format(const std::basic_string& fmt, const Streamable& tp) std::basic_string{}) { std::basic_ostringstream os; + os.exceptions(std::ios::failbit | std::ios::badbit); to_stream(os, fmt.c_str(), tp); return os.str(); }