[C++-sig] Re: register_exception_translator problem in 1.31.0
David Abrahams
dave at boost-consulting.com
Wed Mar 3 20:34:44 CET 2004
Dan Halbert <halbert at bbn.com> writes:
> I am trying to use the exception translator feature stock BPL version
> from Boost 1.31.0. My code is like this:
>
> void
> translate(My::Own::Exception const &e)
> {
> PyErr_SetString( ... );
> }
>
>
> BOOST_PYTHON_MODULE(mod)
> {
> // ...
> register_exception_translator<My::Own::Exception>(translate);
Add an ampersand ('&') here-------------------------------^
> }
>
> However, I get a compile error with gcc 3.2.2 on Linux:
>
> ../py_my_own.cpp: In function `void init_module_mod()':
> ../py_my_own.cpp:68: no matching function for call to `
> register_exception_translator(void (&)(My::Own::Exception&))'
>
> Studying the BPL include files has gotten me nowhere. Can you tell me
> what I'm doing wrong?
HTH,
--
Dave Abrahams
Boost Consulting
www.boost-consulting.com
More information about the Cplusplus-sig
mailing list