|
6 | 6 | #ifndef DATA_MEMBERS_DWA2002328_HPP |
7 | 7 | # define DATA_MEMBERS_DWA2002328_HPP |
8 | 8 |
|
9 | | -# include <boost/python/detail/config.hpp> |
10 | | -# include <boost/python/detail/wrap_python.hpp> |
11 | | -# include <boost/type_traits/transform_traits.hpp> |
12 | | -# include <boost/type_traits/add_const.hpp> |
13 | | -# include <boost/type_traits/add_reference.hpp> |
14 | 9 | # include <boost/python/return_value_policy.hpp> |
15 | 10 | # include <boost/python/return_by_value.hpp> |
16 | 11 | # include <boost/python/return_internal_reference.hpp> |
17 | | -# include <boost/python/object/function_object.hpp> |
18 | 12 | # include <boost/python/arg_from_python.hpp> |
| 13 | + |
| 14 | +# include <boost/python/object/function_object.hpp> |
| 15 | + |
19 | 16 | # include <boost/python/converter/builtin_converters.hpp> |
| 17 | + |
| 18 | +# include <boost/python/detail/indirect_traits.hpp> |
| 19 | +# include <boost/python/detail/config.hpp> |
| 20 | +# include <boost/python/detail/wrap_python.hpp> |
| 21 | + |
| 22 | +# include <boost/type_traits/transform_traits.hpp> |
| 23 | +# include <boost/type_traits/add_const.hpp> |
| 24 | +# include <boost/type_traits/add_reference.hpp> |
| 25 | + |
20 | 26 | # include <boost/mpl/if.hpp> |
| 27 | + |
21 | 28 | # include <boost/bind.hpp> |
22 | 29 |
|
23 | 30 | namespace boost { namespace python { |
@@ -71,16 +78,21 @@ namespace detail |
71 | 78 | // and get the right result. |
72 | 79 | template <class T> |
73 | 80 | struct default_getter_policy |
74 | | - : mpl::if_c< |
75 | | - to_python_value< |
76 | | - typename add_reference< |
77 | | - typename add_const<T>::type |
78 | | - >::type |
79 | | - >::uses_registry |
| 81 | + { |
| 82 | + typedef typename add_reference< |
| 83 | + typename add_const<T>::type |
| 84 | + >::type t_cref; |
| 85 | + |
| 86 | + BOOST_STATIC_CONSTANT( |
| 87 | + bool, by_ref = to_python_value<t_cref>::uses_registry |
| 88 | + && is_reference_to_class<t_cref>::value); |
| 89 | + |
| 90 | + typedef typename mpl::if_c< |
| 91 | + by_ref |
80 | 92 | , return_internal_reference<> |
81 | 93 | , return_value_policy<return_by_value> |
82 | | - > |
83 | | - {}; |
| 94 | + >::type type; |
| 95 | + }; |
84 | 96 | } |
85 | 97 |
|
86 | 98 | template <class C, class D> |
|
0 commit comments