dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #18818
GenericTensor::down_cast() should throw std::bad_cast instead of invoking dolfin::error
-
To:
DOLFIN Mailing List <dolfin@xxxxxxxxxxxxxxxxxxx>
-
From:
Florian Rathgeber <florian.rathgeber@xxxxxxxxxxxxxx>
-
Date:
Sun, 01 Aug 2010 12:40:05 +0200
-
Openpgp:
id=C72D0316
-
User-agent:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Lightning/0.9 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666
-----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