Hi:
I'm now use the boost.python,and want to write my own
converter.
In the last version,I can write like this:
#include <boost/python/class_builder.hpp>
namespace
python = boost::python;
BOOST_PYTHON_BEGIN_CONVERSION_NAMESPACE
inline AsnInt from_python(PyObject* p, python::type<const
AsnInt&>)
{
return AsnInt(from_python(p,
python::type<int>()));
}
inline AsnInt from_python(PyObject* p,
python::type<AsnInt>)
{
return from_python(p,
python::type<const AsnInt&>());
}
inline PyObject* to_python(const AsnInt&
ai)
{
return
PyInt_FromLong((AsnIntType)ai);
}
BOOST_PYTHON_END_CONVERSION_NAMESPACE