what does this declaration mean? exception() throw()

c++, stl

Solution

Without any parameter, it means that the mentioned functions does not throw any exceptions.

If you specify anything as a parameter, you're saying that the function will throw only exceptions of that type. Notice, however, this is not an enforcement to the compiler. If an exception of some other type happens to be thrown the program will call std::terminate().

Problem

std::exception class is defined as follows ``` exception() throw() { } virtual ~exception() throw(); virtual const char* what() const throw(); ``` what does the throw() syntax mean in a declaration? Can throw() take parameters? What does no parameters mean?

Original source

Related problems