boostorg / contract

Contract programming for C++
http://www.boost.org/doc/libs/develop/libs/contract/doc/html/index.html
Boost Software License 1.0
40 stars 27 forks source link

Use uncaught_exceptions from Boost.Core to avoid C++17 warnings #19

Closed Lastique closed 5 years ago

Lastique commented 5 years ago

In C++17, std::uncaught_exception is deprecated in favor of std::uncaught_exceptions. Use portable uncaught_exceptions implementation from Boost.Core, which is also available for C++03.

This fixes gcc 8 warnings about using deprecated features in C++17 mode.

lcaminiti commented 5 years ago

Yes, I will make this change when I have some time in the next few months (this fixed issue #16).

lcaminiti commented 5 years ago

I implemented a fix for this in develop branch (will merged in master for next Boost release). I ended up not using boost::core::uncaught_exception just because I don't need to emulate the exception count. Instead, I use a #ifdef to call std::uncaught_exceptions (plural) when available on later compilers, and kept std::uncaught_exception (singular) on older compilers.