[C++-sig] Supporting container conversions

David Abrahams david.abrahams at rcn.com
Mon Jul 8 23:57:40 CEST 2002


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

> As I see it, the main problem are sequences that absolutely have to be
> converted in one pass. A simple solution would be to use a function
> taking a boost::python::object. In this way overload resolution and
> conversion are decoupled. Thinking about it, this is exactly how
> people emulate overload resolution in Python (evaluate the type(s) of
> the argument(s) inside the function).
> 
> The only general solution I can think of is to support an exception-
> handling-based protocol for overload resolution. I.e., if construct()
> throws an exception of a certain type overload resolution continues as
> if the corresponding convertible() test had failed. Wouldn't that be
> easy to implement?

Sure, but I don't see how it would help anything.

-Dave






More information about the Cplusplus-sig mailing list