On Thu, Apr 25, 2013 at 4:05 AM, Pierre T.
If we want to stick to a single class, I think that the expected<T> containing a std::exception_ptr is best. Why ? Because it enables cool features with current_exception and because the standard provides exception classes even for error code. The new error_condition/error_code class can be wrapped into system_error which is an exception. That's mean that the standard provides exception classes even for error code. If we take that into account, I think expected<T> with exception inside is enough. For non-standard error code, the user can easily wrap an error inside an exception (even if the user never thrown). We could provide facilities for wrapping error code inside exception too.
If you think I'm right, I'd like to focus my proposal on such an idea. Time is missing (at least for the GSoC), and I must hurry up.
Thanks for the great discussions, Pierre T.
I think you should do whatever you think is best. At least get started
down that road. It always can be (and will be) tweaked later.
I would just like to keep in mind *some* way for the simple 'error code'
case to be handled (and I don't mean std::error_code, which looks too
complicated or not appropriate for custom errors). ie a simple wrapper
enum MyErrors
{
PrinterOnFire, DeveloperGoneInsane, ....
};
expected