|
13 | 13 | # include <boost/type_traits/cv_traits.hpp> |
14 | 14 | # include <boost/python/return_value_policy.hpp> |
15 | 15 | # include <boost/python/copy_non_const_reference.hpp> |
| 16 | +# include <boost/python/object/function_object.hpp> |
16 | 17 |
|
17 | 18 | namespace boost { namespace python { |
18 | 19 |
|
@@ -61,47 +62,45 @@ namespace detail |
61 | 62 | } |
62 | 63 |
|
63 | 64 | template <class C, class D> |
64 | | -objects::function* make_getter(D C::*pm) |
| 65 | +object make_getter(D C::*pm) |
65 | 66 | { |
66 | 67 | typedef return_value_policy<copy_non_const_reference> default_policy; |
67 | | - return new objects::function( |
68 | | - objects::py_function( |
69 | | - ::boost::bind( |
70 | | - &detail::member<D,C,default_policy>::get, pm, _1, _2 |
71 | | - , default_policy())) |
| 68 | + |
| 69 | + return objects::function_object( |
| 70 | + ::boost::bind( |
| 71 | + &detail::member<D,C,default_policy>::get, pm, _1, _2 |
| 72 | + , default_policy()) |
72 | 73 | , 1); |
| 74 | + |
73 | 75 | } |
74 | 76 |
|
75 | 77 | template <class C, class D, class Policies> |
76 | | -objects::function* make_getter(D C::*pm, Policies const& policies) |
| 78 | +object make_getter(D C::*pm, Policies const& policies) |
77 | 79 | { |
78 | | - return new objects::function( |
79 | | - objects::py_function( |
| 80 | + return objects::function_object( |
80 | 81 | ::boost::bind( |
81 | 82 | &detail::member<D,C,Policies>::get, pm, _1, _2 |
82 | | - , policies)) |
| 83 | + , policies) |
83 | 84 | , 1); |
84 | 85 | } |
85 | 86 |
|
86 | 87 | template <class C, class D> |
87 | | -objects::function* make_setter(D C::*pm) |
| 88 | +object make_setter(D C::*pm) |
88 | 89 | { |
89 | | - return new objects::function( |
90 | | - objects::py_function( |
91 | | - ::boost::bind( |
92 | | - &detail::member<D,C,default_call_policies>::set, pm, _1, _2 |
93 | | - , default_call_policies())) |
| 90 | + return objects::function_object( |
| 91 | + ::boost::bind( |
| 92 | + &detail::member<D,C,default_call_policies>::set, pm, _1, _2 |
| 93 | + , default_call_policies()) |
94 | 94 | , 2); |
95 | 95 | } |
96 | 96 |
|
97 | 97 | template <class C, class D, class Policies> |
98 | | -objects::function* make_setter(D C::*pm, Policies const& policies) |
| 98 | +object make_setter(D C::*pm, Policies const& policies) |
99 | 99 | { |
100 | | - return new objects::function( |
101 | | - objects::py_function( |
102 | | - ::boost::bind( |
103 | | - &detail::member<D,C,Policies>::set, pm, _1, _2 |
104 | | - , policies)) |
| 100 | + return objects::function_object( |
| 101 | + ::boost::bind( |
| 102 | + &detail::member<D,C,Policies>::set, pm, _1, _2 |
| 103 | + , policies) |
105 | 104 | , 2); |
106 | 105 | } |
107 | 106 |
|
|
0 commit comments