X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FException.cti;h=ea123701100f23b8a71f46539b020a5a3dd201fe;hb=412024ed31a4ab4eaea7a4165a434f8efebee325;hp=3588cdcac3dc29c9d5e357ca7f04c39c597001da;hpb=1d247d12d1759ffd77f456efe3a52f03dd289994;p=senf.git diff --git a/Utils/Exception.cti b/Utils/Exception.cti index 3588cdc..ea12370 100644 --- a/Utils/Exception.cti +++ b/Utils/Exception.cti @@ -31,11 +31,32 @@ #define prefix_ inline ///////////////////////////////cti.p/////////////////////////////////////// -template -prefix_ senf::Exception & senf::Exception::operator<<(Arg const & arg) +template +prefix_ typename boost::enable_if< boost::is_convertible, Exc & >::type +senf::operator<<(Exc const & exc, Arg const & arg) { - message_ += boost::lexical_cast(arg); - return *this; + const_cast(exc).append( boost::lexical_cast(arg) ); + return const_cast(exc); +} + +/////////////////////////////////////////////////////////////////////////// +// senf::WrapExcecption + +template +prefix_ senf::WrapException::WrapException(BaseException const & base) + : ExceptionMixin(base.what()), BaseException(base) +{} + +template +prefix_ senf::WrapException::~WrapException() + throw() +{} + +template +prefix_ char const * senf::WrapException::what() + const throw() +{ + return message().c_str(); } /////////////////////////////cti.e///////////////////////////////////////