From 48baa942fc2957917230baddd169f8d6326ec29d Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Wed, 6 Jun 2018 13:52:23 -0400 Subject: [PATCH] Use uncaught_exceptions in C++17 --- README.md | 2 +- include/date/date.h | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3595974..1dd0eca 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ --- -**[Try it out on wandbox!](https://wandbox.org/permlink/akDd3tAEwxZtdB2B)** +**[Try it out on wandbox!](https://wandbox.org/permlink/L8MwjzSSC3fXXrMd)** ## Summary diff --git a/include/date/date.h b/include/date/date.h index 6665411..f3cd7de 100644 --- a/include/date/date.h +++ b/include/date/date.h @@ -1080,7 +1080,12 @@ class save_ostream public: ~save_ostream() { - if ((this->flags_ & std::ios::unitbuf) && !std::uncaught_exception() && + if ((this->flags_ & std::ios::unitbuf) && +#if __cplusplus >= 201703 + std::uncaught_exceptions() == 0 && +#else + !std::uncaught_exception() && +#endif this->is_.good()) this->is_.rdbuf()->pubsync(); }