[C++-sig] wrapping a vector data member

Tim Spens t_spens at yahoo.com
Mon Jul 23 20:30:27 CEST 2007


I'm not sure why I'm getting this error from the
follownig code?

// data member from sig_zapv class
std::vector<C4::ZEE::zap> zaps_;

//boost python wrapper part
class_<sig_zapv, bases<params> >("sig_zapv")
  .def(init<>())
  .def(vector_indexing_suite<std::vector<C4::ZEE::zap>
>());

//error
../../SDK/boost_1_33_1/boost/python/with_custodian_and_ward.hpp:
In static 
   member function `static PyObject* 
  
boost::python::with_custodian_and_ward_postcall<custodian,
ward, 
   BasePolicy_>::postcall(const ArgumentPackage&,
PyObject*) [with 
   ArgumentPackage = PyObject*, unsigned int custodian
= 0, unsigned int ward = 
   1, BasePolicy_ =
boost::python::default_call_policies]':
../../SDK/boost_1_33_1/boost/python/detail/caller.hpp:201:
  instantiated from `PyObject*
boost::python::detail::caller_arity<1>::impl<F,
Policies, Sig>::operator()(PyObject*, PyObject*) [with
F =
boost::python::objects::iterator_range<boost::python::return_internal_reference<1,
boost::python::default_call_policies>,
__gnu_cxx::__normal_iterator<C4::ZEE::zap*,
std::vector<C4::ZEE::zap, std::allocator<C4::ZEE::zap>
> > >::next, Policies =
boost::python::return_internal_reference<1,
boost::python::default_call_policies>, Sig =
boost::mpl::vector2<C4::ZEE::zap&,
boost::python::objects::iterator_range<boost::python::return_internal_reference<1,
boost::python::default_call_policies>,
__gnu_cxx::__normal_iterator<C4::ZEE::zap*,
std::vector<C4::ZEE::zap, std::allocator<C4::ZEE::zap>
> > >&>]'
../../SDK/boost_1_33_1/boost/python/object/py_function.hpp:38:
  instantiated from `PyObject*
boost::python::objects::caller_py_function_impl<Caller>::operator()(PyObject*,
PyObject*) [with Caller =
boost::python::detail::caller<boost::python::objects::iterator_range<boost::python::return_internal_reference<1,
boost::python::default_call_policies>,
__gnu_cxx::__normal_iterator<C4::ZEE::zap*,
std::vector<C4::ZEE::zap, std::allocator<C4::ZEE::zap>
> > >::next,
boost::python::return_internal_reference<1,
boost::python::default_call_policies>,
boost::mpl::vector2<C4::ZEE::zap&,
boost::python::objects::iterator_range<boost::python::return_internal_reference<1,
boost::python::default_call_policies>,
__gnu_cxx::__normal_iterator<C4::ZEE::zap*,
std::vector<C4::ZEE::zap, std::allocator<C4::ZEE::zap>
> > >&> >]'
../../SDK/boost_1_33_1/boost/python/object/make_instance.hpp:32:
  instantiated from here
../../SDK/boost_1_33_1/boost/python/with_custodian_and_ward.hpp:87:
warning: comparison
   of unsigned expression < 0 is always false
make[1]: *** [wrapper.o] Error 1



       
____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online.
http://smallbusiness.yahoo.com/webhosting 



More information about the Cplusplus-sig mailing list