mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-04 13:14:26 +02:00
Use uncaught_exceptions in C++17
This commit is contained in:
@@ -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
|
||||
|
||||
|
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user