[C++-sig] Boost.Python v2: user-accessible from_python conversions

David Abrahams david.abrahams at rcn.com
Wed Jul 3 05:18:56 CEST 2002


The thing is, you still need a try/catch block for your application,
because even though the convertible() function won't throw, the function
which does the actual conversion might throw.

So in your case you can gain some efficiency in overload resolution when
conversion fails, by detecting that conversion will fail without using a
C++ exception, but you'll still need the code to handle one. Does that
change your vote?

BTW, I'm now inclined to go your way on this ;-)

-Dave

----- Original Message -----
From: "Ralf W. Grosse-Kunstleve" <rwgk at yahoo.com>


> --- David Abrahams <david.abrahams at rcn.com> wrote:
> > Oh, I see.
> > Well the problem with that is that extract<> is going to throw an
exception
> > if it fails to find the right type, and your convertible() function
should
> > not throw.
>
> That leads me to believe that I should cast my vote (if I have one) for
the
> class-based extract<> implementation.
> Ralf
>
>
> __________________________________________________
> Do You Yahoo!?
> Sign up for SBC Yahoo! Dial - First Month Free
> http://sbc.yahoo.com
>
>
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig






More information about the Cplusplus-sig mailing list