Rethrow an exception like in C++?

Rob T alanb at ucora.com
Fri Mar 8 11:52:21 PST 2013


On Friday, 8 March 2013 at 06:05:02 UTC, Maxim Fomin wrote:
>     catch (Exception e) {
>         if (typeid(e) == typeid(myException1))
>             throw e; // may be downcasted, if necessary
>                      // to work with specific fields
>     }


Isn't it better to check identity in this way?

if (typeid(e) is typeid(myException1))

--rt


More information about the Digitalmars-d-learn mailing list