throw () after function declaration in c++ exception struct?

It means it won’t throw any exceptions. This is an important guarantee for a function like what, which is usually called in exception handling: you don’t want another exception to be thrown while you’re trying to handle one.

In C++11, you generally should use noexcept instead. The old throw specification is deprecated.

Leave a Comment