"Studious Apprentice" <apprentice_99@hotmail.com> writes:
Thanks a lot for this fast answer ! This looks like the way to go. The following code does compile but the result under python is unexpected :
#include <boost/python.hpp> #include <boost/python/raw_function.hpp> using namespace boost::python;
namespace { class X { public: object memberraw(const tuple& args, const dict& kw) { return make_tuple(args, kw); } };
object memberrawfwd(tuple raw, dict kw) { tuple arg = extract<tuple&>(raw.slice(1, _))();
Why didn't you just do it the way I told you to? Did that fail somehow? This should be tuple arg( raw.slice(1,_) );
return extract<X&>(raw[0])(). memberraw(arg, kw); }
};
BOOST_PYTHON_MODULE(PythonTest) { class_<X>("X") .def("memberraw", raw_function(memberrawfwd)) ; }
-- Dave Abrahams Boost Consulting www.boost-consulting.com