Deprecated Throw-List in C++11

How to replace dynamic exception specifications: throw(...)

Just remove the dynamic exception specification. That's all you need to do.

C++ is not Java; in C++, all functions are (at a language level) assumed to throw anything unless they are tagged noexcept. As such, if you remove the exception specification, it will work exactly as it did before.

c++1z dynamic exception specification error

C++17 removed dynamic exception specifications, as a result of P0003. Before that, they had been deprecated since C++11. They are no longer part of the language, so there isn't really a way to fix it. As long as you need that third party library, until it changes, you're stuck on C++14.


If you're desperate, you could try:

#define throw(...)

but I wouldn't recommend it.



Related Topics



Leave a reply



Submit