7 Jun
2020
7 Jun
'20
9:12 a.m.
El 07/06/2020 a las 11:00, Joaquin M López Muñoz escribió:
I'd say this doesn't add complexity for the user, but on the contrary makes it easier to detect and adapt result types. I'm thinking about something like this:
[...] static bool has_error(T& x){return static_cast<bool>(x);}
This should be static bool has_error(T& x){return !static_cast<bool>(x);} Of course. Another question: why does leaf::catch_<E> require that E be derived from std::exception? Can't I throw any arbitrary type I please? Joaquín M López Muñoz