[C++-sig] Re: register_exception_translator problem in 1.31.0
David Abrahams
dave at boost-consulting.com
Wed Mar 3 22:49:37 CET 2004
Dan Halbert <halbert at bbn.com> writes:
> >> register_exception_translator<My::Own::Exception>(translate);
> >Add an ampersand ('&') here-------------------------------^
>
> Ah, so the tutorial example is wrong. Thank you!
> (Bad example is at http://www.boost.org/libs/python/doc/tutorial/doc/exception_translation.html)
http://www.boost.org/libs/python/doc/v2/exception_translator.html
gets it right.
Hmm. Do me a favor, please. In exception_translator.hpp, change:
template <class ExceptionType, class Translate>
void register_exception_translator(Translate const& translate, boost::type<ExceptionType>* = 0)
^^^^^^
to:
template <class ExceptionType, class Translate>
void register_exception_translator(Translate translate, boost::type<ExceptionType>* = 0)
and try your example again. I expect it works, and if so I'm inclined
to change the signature of register_exception_translator.
--
Dave Abrahams
Boost Consulting
www.boost-consulting.com
More information about the Cplusplus-sig
mailing list