Boost logo

Boost :

From: Gerhard Wesp (gwesp_at_[hidden])
Date: 2006-05-24 06:21:04


> That makes sense to me. It wouldn't be useful to throw an exception because
> of the asynchronous nature of the control flow, so supplying a error_code to
> the callback gives it a chance to deal with the error, or ignore it if
> desired. Was that your analysis?

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() ;

Regards
-Gerhard

-- 
Gerhard Wesp
ZRH office voice: +41 (0)44 668 1878
ZRH office fax: +41 (0)44 200 1818
For the rest I claim that raw pointers must be abolished.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk