[Licq-devel] Re: Exceptions
Rudo Thomas <[email protected]>
| Newsgroups | gmane.network.licq.devel |
|---|---|
| Message-ID | <[email protected]> |
> > The second question is, should we use throw-specifications when > > defining methods or simply document which exceptions are thrown? > > throw() specification on functions looks better to me, that way the > compiler can also check if we throw something illegal. It is not that simple with C++: It is specifically allowed to throw an exception that is not mentioned in the exception-specification (while this could be detected in some cases, g++-3.4.6 does not print any warnings). These situations are detected at run-time and if they happen, unexpected() is called. See the C++ Standard, section 15.4, par 8 to 10. I hope this helps. Rudo.