2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-19 04:22:16 +00:00

fixed name collision

[SVN r22682]
This commit is contained in:
Nikolay Mladenov
2004-04-21 18:49:06 +00:00
parent 8ed4c145ed
commit ef802e1691

View File

@@ -5,16 +5,23 @@
namespace boost {namespace python {namespace converter{
namespace detail{
inline void * identity (PyObject *p){return p;}
namespace strip_type_info{
BOOST_PYTHON_DECL void insert(boost::python::type_info, boost::python::type_info);
BOOST_PYTHON_DECL type_info query(boost::python::type_info);
}
class python_class_base : public PyObject{
python_class_base ();
public:
static void *converter (PyObject *p){return p;}
};
}// namespace converter::detail
template <class T> struct python_class : PyObject
template <class T> struct python_class : detail::python_class_base
{
typedef python_class<T> this_type;
typedef T type;
@@ -24,14 +31,12 @@ template <class T> struct python_class : PyObject
if ( !first_time ) return;
first_time = false;
converter::registry::insert(&detail::identity, boost::python::type_id<this_type>());
converter::registry::insert(&detail::python_class_base::converter, boost::python::type_id<this_type>());
converter::detail::strip_type_info::insert(boost::python::type_id<type>(), boost::python::type_id<type*>());
converter::detail::strip_type_info::insert(boost::python::type_id<type>(), boost::python::type_id<type const *>());
converter::detail::strip_type_info::insert(boost::python::type_id<type>(), boost::python::type_id<this_type*>());
converter::detail::strip_type_info::insert(type_id<type>(), type_id<shared_ptr<type> >());
}
private:
python_class();
};