This (const klass&) cast can be dangerous when virtual inheritance is involved (as it should with exception classes, http://www.boost.org/doc/libs/1_53_0/libs/exception/doc/using_virtual_inheritance_in_exception_types.html).