[C++-sig] bpl_utils explained

David Abrahams dave at boost-consulting.com
Mon Jul 29 10:45:01 CEST 2002


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


> --- David Abrahams <dave at boost-consulting.com> wrote:
> > > Now say std::vector<int> is class 1 & 2 convertible, and
> > > std::vector<double> only class 2. If the object to be converted
> > > is a wrapped std::vector<int> it will be converted class 1,
> > > otherwise the overload tried first will be used.
> >
> > That would be nice, but it ain't so. If the vector<double> overload is
> > tried first it will match, and overload resolution will stop there.
>
> Ouch.
>
> Please forgive me, but I still feel I can protect myself from confusing
> situations due to the "naive" overload resolution mechanism by
restricting the
> from_python_sequence converters to lists, tuples, iterators and xranges.
For
> the time being. To be relaxed once the overload resolution mechanism is
> enhanced. Does that make sense as an interim approach?

Sure.


-----------------------------------------------------------
           David Abrahams * Boost Consulting
dave at boost-consulting.com * http://www.boost-consulting.com





More information about the Cplusplus-sig mailing list