
On 5/24/06, Gerhard Wesp <gwesp@google.com> wrote:
Is it necessary to differentiate between error codes and exceptions? An exception *is* an error code for me. IOW, it might make sense to derive an error_code class from std::exception.
Assume we have two similar functions f1() and f2() with the same possible failure modes. We'd like f1() to throw and f2() not.
The prototypes might look like:
void f1(arguments...) throw(std::exception); std::auto_ptr<std::exception> f2(arguments...) throw();
This doesn't work in the context of asio in particular where there are async functions that return immediately and can only detect/indicate an error condition at a later time (e.g. by passing it to the Handler function). See for example: http://asio.sourceforge.net/boost-asio-proposal-0.3.6/libs/asio/doc/referenc... -- Caleb Epstein caleb dot epstein at gmail dot com