← Back to team overview

dolfin team mailing list archive

GenericTensor::down_cast() should throw std::bad_cast instead of invoking dolfin::error

 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

When using GenericTensor::down_cast() for a tentative down cast it would
be helpful if it would throw std::bad_alloc (as any dynamic_cast would
do) instead of invoking dolfin::error. Currently you would have to catch
std::runtime_error and check what() to distinguish a failed cast from
another dolfin::error, which is pretty inconvenient. Is there a specific
reason why it is implemented this way?

Florian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (MingW32)

iEYEARECAAYFAkxVTwUACgkQ8Z6llsctAxZL/ACdF7itkMxz9NX1GAx7m3bxw0jH
LxUAoNqcxH5oXt7Q6q559s472RVGFuc/
=rxNO
-----END PGP SIGNATURE-----

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Follow ups