2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-25 18:32:24 +00:00

merged from trunk

[SVN r18264]
This commit is contained in:
Dave Abrahams
2003-04-16 14:32:58 +00:00
parent 88e7049a5b
commit 8678283629
4 changed files with 58 additions and 0 deletions

View File

@@ -6,9 +6,11 @@
#ifndef MAKE_INSTANCE_DWA200296_HPP
# define MAKE_INSTANCE_DWA200296_HPP
# include <boost/python/detail/wrap_python.hpp>
# include <boost/python/object/instance.hpp>
# include <boost/python/converter/registered.hpp>
# include <boost/python/detail/decref_guard.hpp>
# include <boost/python/detail/none.hpp>
namespace boost { namespace python { namespace objects {
@@ -24,6 +26,9 @@ struct make_instance_impl
PyTypeObject* type = Derived::get_class_object(x);
if (type == 0)
return python::detail::none();
PyObject* raw_result = type->tp_alloc(
type, objects::additional_instance_size<Holder>::value);

View File

@@ -34,6 +34,9 @@ struct make_ptr_instance
template <class U>
static inline PyTypeObject* get_class_object_impl(U const volatile* p)
{
if (p == 0)
return 0;
PyTypeObject* derived = get_derived_class_object(is_polymorphic<U>::type(), p);
if (derived)
return derived;