
23 Jun
2012
23 Jun
'12
8:13 p.m.
on Sat Jun 23 2012, "Robert Ramey" <ramey-AT-rrsd.com> wrote:
If you really like boost::exception your code when you eventually can eventually rethrow
catch (std::exception e){ BOOST_EXCEPTION_THROW_EXCEPTION(e) }
IIUC, even if you change it to catch by reference, as you should, and even if std::exception weren't an abstract base class, which it is, that approach will slice the caught exception and lose all the information thrown with it. BOOST_EXCEPTION_THROW_EXCEPTION needs to copy the exception object into this type it builds with multiple inheritance from boost::exception, and it needs to do this with full knowledge of the static type of the exception being thrown. -- Dave Abrahams BoostPro Computing http://www.boostpro.com