[C++-sig] V2: coerce method howto?

Pearu Peterson pearu at cens.ioc.ee
Sun Apr 21 12:40:49 CEST 2002


Hi,

Consider the following coerce method template

boost::python::tuple ex_coerce(const GiNaC::ex & left,
                               boost::python::ref right) {
  return boost::python::tuple(left,right);
}

but when trying to compile it I get

boost/boost/python/objects.hpp: In member function `void 
   boost::python::tuple::set_item(unsigned int, const T&) [with T = 
   GiNaC::ex]':
boost/boost/python/objects.hpp:74:   instantiated from
`boost::python::tuple::tuple(const First&, const Second&) [with First =
GiNaC::ex, Second = boost::python::ref]'
src/_ginac.cpp:29:   instantiated from here
boost/boost/python/objects.hpp:100: `make_ref' undeclared (first use this 
   function)
boost/boost/python/objects.hpp:100: (Each undeclared identifier is
reported 
   only once for each function it appears in.)
interrupted

I guess that it is an issue of not-implemented-feature but I am not sure.
So, what is the recommended way to implement coerce method within BPL V2?

Pearu






More information about the Cplusplus-sig mailing list