Exception handling (programming): Difference between revisions

Content deleted Content added
Line 191:
Early versions of the C++ programming language included an optional mechanism similar to checked exceptions, called '''exception specifications'''. By default any function could throw any exception, but this could be limited by a {{Cpp|throw}} clause (similar to the {{Java|throws}} clause in Java) added to the function signature, that specified which exceptions the function may throw.
 
<syntaxhighlight lang="JavaC++">
void doIOOperationperformLogicalOperation(int a, int b) throw(std::ios_baseinvalid_argument, std::failuredomain_error) {
// ...
}