2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-22 17:32:55 +00:00

Added wrapper for PyObject*

[SVN r12234]
This commit is contained in:
Dave Abrahams
2002-01-06 14:40:33 +00:00
parent 03fef3106d
commit cdac34efea

View File

@@ -12,12 +12,6 @@ namespace boost { namespace python { namespace converter {
wrapper_base::wrapper_base(type_id_t type)
: body(type)
{
// static assertions for target<T>. These would go in a header,
// but Metrowerks only respects BOOST_STATIC_ASSERT if it is in an
// instantiated function
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#else
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
registry::insert(*this);
}
@@ -27,4 +21,21 @@ wrapper_base::~wrapper_base()
registry::remove(*this);
}
namespace
{
// This doesn't actually get called, but we need something to fill
// in the slot in the wrap<PyObject*> class.
struct identity_wrapper_t : wrapper<PyObject*>
{
PyObject* convert(PyObject* source) const
{
return source;
}
};
identity_wrapper_t identity_wrapper_object;
}
BOOST_PYTHON_DECL body& identity_wrapper = identity_wrapper_object;
}}} // namespace boost::python::converter