4 ms·
Read up on exception specifiers in C++ and reconsider this comment.
by aidenn0 15y ago
Read up on exception specifiers in C++ and reconsider this comment.
- davedx 15y agoI just did; what I couldn't figure out, was is there a way to specify multiple different exception types in your C++ throw()? In Java, you can do: public int myfunc(int a, int b) throws IOException, InvalidGoatException {} How would you do this in C++?
- cbsmith 15y agoYou can do much the same thing, only the meaning is the reverse.
- signa11 15y ago> @davedx asks : is there a way to specify multiple different exception types in your C++ throw()? yeah throw() can contain multiple types that can possibly be emitted e.g. int foo() throw(a,b,c,d) implies that foo can only throw either a/b/c/d types.
- Peaker 15y agoExcept that is only enforced at runtime, and converts the exception type to unexpected_exception, which is even worse!
- pubby 15y agoException specifiers are deprecated and for good reason.