Release 1.39.0
[boost.git] / Boost_1_39_0 / boost / python / manage_new_object.hpp
blobd81421dace85b848d31097a4a2563630dd80b1da
1 // Copyright David Abrahams 2002.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
5 #ifndef MANAGE_NEW_OBJECT_DWA200222_HPP
6 # define MANAGE_NEW_OBJECT_DWA200222_HPP
8 # include <boost/python/detail/prefix.hpp>
9 # include <boost/python/detail/indirect_traits.hpp>
10 # include <boost/mpl/if.hpp>
11 # include <boost/python/to_python_indirect.hpp>
12 # include <boost/type_traits/composite_traits.hpp>
14 namespace boost { namespace python {
16 namespace detail
18 template <class R>
19 struct manage_new_object_requires_a_pointer_return_type
20 # if defined(__GNUC__) && __GNUC__ >= 3 || defined(__EDG__)
22 # endif
26 struct manage_new_object
28 template <class T>
29 struct apply
31 typedef typename mpl::if_c<
32 boost::is_pointer<T>::value
33 , to_python_indirect<T, detail::make_owning_holder>
34 , detail::manage_new_object_requires_a_pointer_return_type<T>
35 >::type type;
39 }} // namespace boost::python
41 #endif // MANAGE_NEW_OBJECT_DWA200222_HPP