mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-27 00:14:07 +08:00
Use uncaught_exceptions in C++17
This commit is contained in:
parent
af415701ba
commit
48baa942fc
@ -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
|
## Summary
|
||||||
|
|
||||||
|
@ -1080,7 +1080,12 @@ class save_ostream
|
|||||||
public:
|
public:
|
||||||
~save_ostream()
|
~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_.good())
|
||||||
this->is_.rdbuf()->pubsync();
|
this->is_.rdbuf()->pubsync();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user