[C++-sig] Re: Problem with std::vector<boost::python::object>
David Abrahams
dave at boost-consulting.com
Mon Jul 28 18:18:29 CEST 2003
Pierre Barbier de Reuille <pierre.barbier at cirad.fr> writes:
> I'd want to know why I can't compile this:
>
> void insert( vector<object>* o, object obj )
> {
> insert_iterator<vector<object> > ii( *o, o->end() );
> *ii = obj;
> }
>
> I use g++-3.2 and the output is:
>
> /usr/include/c++/3.2/bits/stl_vector.h:550: conversion from `
> boost::python::api::object' to non-scalar type `
> __gnu_cxx::__normal_iterator<boost::python::api::object*,
> std::vector<boost::python::api::object,
> std::allocator<boost::python::api::object> > >' requested
A number of obscure reasons having to do with argument-dependent
lookup and the templated operators on boost::python::object
contribute.
A fix is possible by using
enable_if<mpl::or_<is_object<x>, is_object<y> >, ...>
to restrict the templated operators' applicability. Patches welcomed.
--
Dave Abrahams
Boost Consulting
www.boost-consulting.com
More information about the Cplusplus-sig
mailing list